cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
peteaxtell
Helper I
Helper I

Refreshing a datasource

I am using SharePoint. If the data model has not changed, is there ever a need to refresh the data source when using the app? I am not storing any data locally (not using ClearCollect or Collect) so each call will be doing directly to the server. In which case, what is Refresh(sharepointlist) actually doing other than looking for changes to columns.

2 REPLIES 2
Pstork1
Dual Super User III
Dual Super User III

Even when not using local data the data from a data source is cached locally on the device in places like a Gallery.  Refresh(sharepointlist) will look for changes to the data, not changes to the schema.  So it is used to make sure that you have the latest data with all the changes submitted by you and any others.  Refresh in the data section of the power apps studio isn't the same thing as this function.  It will look for changes to the schema of the data source.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
RandyHayes
Super User
Super User

@peteaxtell 

No, the only reason to refresh the DataSource in your app is in the scenario where you have other external factors updating the SharePoint list as well (i.e. another app, a flow, or just someone entering information in the list) and you need to have the most current data in your app.

If this is not a factor, then there is no reason to refresh the datasource.

 

Refresh on a datasource actually simply clears out the session datasource that is in your Cloud session.  Then, depending on various factors (app data consumption, advanced settings to govern data, etc.) the cloud session will retrieve information from the real datasource as it needs.  This is then available to your app as needed.  IN other words, its a collection in the cloud that you then get data from.  This is why it is not real-time refreshing to the datasource...it's a static collection.  The only way to get it filled with new data (just like a collection) is to refresh it...in the case of the collection, it is a ClearCollect.

 

As @Pstork1 mentions (and based on your comment about data model changes) none of the above deals with schema changes.  If you are concerned over schema changes, then this is something you would be dealing with in the app.

Schema changes to your datasource CAN happen without impacting your app as long as the changes do not change anything that your app is relying on.  In other words, if someone adds a choice column to the list, your app will be fine.  If someone changes a text column that you are using in the app to a choice column, then things will go wrong and you need to refresh the datasource IN the designer to account for the change (and then all the places that it is used in the app).

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,396)