Skip to content
Home » Refresh function in Power Apps

Refresh function in Power Apps

The Refresh function is used to refresh or update data from the data source, ensuring that the app displays the most current data. Refresh has no return value.

Syntax:

Refresh( DataSource )
  • DataSource – Required. The name of data source that you want to refresh (e.g., a SharePoint list, Excel file, SQL table).
There are several important considerations to keep in mind when you are using Refresh.




  • Frequent Refreshes: Refreshing a data source often can negatively impact app performance, especially for large datasets or slow connections. Refreshing data unnecessarily can lead to increased load times.
  • Data Source Type: Some data sources (e.g., SharePoint,  Excel, SQL Server) may take longer to refresh, particularly if the dataset is large. Try to minimize the frequency of refreshes to improve performance.

Using Refresh to refresh the data

As you can see, here we have Sharepoint list called Records and it contains 4 records.

Here, we have a Gallery which is connected to Sharepoint list and showing those records.

Let’s manually add a record to the SharePoint list and then use the Refresh function to retrieve the latest data into the gallery.

Before doing that, add a button and name it ‘Refresh’. Then, go to the button’s OnSelect property and write the following formula.

Refresh(Records)

So, when the user clicks the button, it will refresh the Records data source to retrieve the latest data.

Let’s add a record to the Records data source. As you can see, we have added a new record with ID 5.

However, this record will not immediately appear in the gallery until the gallery or the app is refreshed, as the record was added externally.

Let’s run the app and click the Refresh button to retrieve the latest data.




We have  covered one example of using the Refresh function, but there are many scenarios where it can be useful

Scenario when to use Refresh:

  • When you make any changes to the data such as Add, update or delete, you might want to refresh the data source to ensure the latest data is loaded.
  •  If data in your source is updated externally (outside of Power Apps), calling the Refresh function will retrieve those updates.
  • Add a Refresh button on the Screen so that users can manually refresh the data source when they want to see the most current data.

 

Loading

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SQL BI Tutorials

Subscribe now to keep reading and get access to the full archive.

Continue reading