How To Refresh A Data Source In PowerApps Step by Step

powerapps how to refresh data source

There are two scenarios where you might want to refresh a data source:

  • The structure of the data source has changed
    For instance there is a new column, a data type has changed, names have changed or column has been deleted. We’ll show you how to refresh your PowerApp data source, so you can work with the changes made on the data source.
  • The data of the data source has changed
    The data within your data source has changed which is not controlled by PowerApps itself. When you change data via PowerApps functions within a user session in general PowerApps is smart enough to refresh the changed data automatically. But when you change a SharePoint List’s content in SharePoint’s web interface or in another usere’s session the PowerApp is not automatically reloaded. Of course the next time the data is loaded the new data will appear. You can programmatically trigger a refresh of the data source’s data.

This article shows you how to handle both scenarios. Note although we use SharePoint lists as an example, your data source might be an Excel table, a database table or a Google sheet. It does not matter, all demonstrated methods work to update your data source.

How To Refresh A Data Source’s Structure In PowerApps

You have a SharePoint list in your PowerApp. Within SharePoint’s web interface you’ve added a new field. The PowerApp does not know of the new field, because it was not there as the SharePoint list was initially imported. To be able to use the new field simple refresh the data source. This will trigger a reload of the data source’s meta data.

  1. Open your PowerApp for editing

  2. Go to data perspective, click on the dots on the right of your data source and click on ‘Refresh’

    powerapps how to refresh data source

    PowerApps – How to refresh data source

How To Refresh A Data Source’s Data In PowerApps

To provide a fast user interface PowerApps does implicitly use caches. This way data does not need to be requested from the server whenever it is needed.

In case you change data in your data source for instance via Patch or SubmitForm PowerApps is smart enough to reload the data on its own.

But when a different user changes data or the data is changed outside of PowerApps the app is not notified. To enforce the loading of the current data, you can use the Refresh function.

See as example below the reload icon as button to reload the data source for the sample gallery:

powerapps refresh data source on button click
PowerApps – Refresh data source on button click

Refresh function

The refresh function reloads the provided data source, so you get the current data from the data source.

Syntax

Refresh( DataSource )

Parameters

  • DataSource (mandatory): The data source that you want to refresh (for instance a SharePoint List).

2 thoughts on “How To Refresh A Data Source In PowerApps Step by Step”

  1. I have used the same syntax but data is not getting updated? I am just trying to add a field in SharePoint and trying to refresh data but the recently added data is not appearing.

    Can you please help me with that.

Leave a Comment

Your email address will not be published.