Mr Shane thank you for helping me see the light. We migrated our powerapps datasources from excel tables to sharepoint lists and patches ended up taking several minutes. Went through just now and uprooted almost every single Refresh and the difference is unbelievable. I'm a refresh truther now!!
Just want to say thank you Shane. I never used refresh so far but asked me just yesterday how I could select an item and show the selected item in one screen. Now I know that forms is the way to go.
I don't think I've ever had to use refresh() in a standalone Power App. However, I have repeatedly had to use it in customized forms embedded in a SharePoint list. The basic problem was that a user could edit a form click save, and then if they reopened that item again in the list edit (without refreshing their browser or clicking on a new item in the list) the old data would still be there. It led many users to thinking their changes weren't being saved, or worse, they'd re-save a new change to find their earlier thing they corrected was wrong again. Only solution that worked, suggested on the PowerApps forums, was to refresh the datasource as part of the OnSuccess property of the edit form. That post on the forums still gets lots of hits even a year later.
Great content! This solved an issue for me where my flow completion was happening and the gallery wasn't getting updated. Refresh wasn't even working. Patch solved it.
Hello Shane, thanks for the explanation. Since the video uploaded around three years ago, I'm asking this question. Is the refresh function still responds the same way as you mentioned? I have a requirement to show content in a table/gallery but need to see live updates (not really live updates but needs to see if any updates made) if another user updates another record same time. I was thought about make use of refresh with timer control, but as you mentioned the refresh function will invalidate the cache and reloads all records, without considering filters, but the table which I shows the data have a filtered content and which will end up with multiple API calls. Could you please suggest me a better way, or if this is already fixed in PowerApps?
Thanks for the video Shane :) Apparently, I will try to use less Refresh the function, but I cannot stop using it at all, sorry. There were a lot of situations when I used Patch the function to update a field value (its type is "*blah-blah*.SharePoint.SPListExpandedReference") in my SPO list, and I was getting an error. I don't remember the error's text, but the meaning was "something went wrong on a server side, you should update the data source)". And... (I'm really sorry), for now, I am using Refresh call BEFORE the Patch and Refresh AFTER the Patch. Such configuration is the only one option that I found to avoid the error. Thank you a lot for your videos, it's really helpful and useful. Merry Christmas to you and Happy New Year 🎄 🎄 🎄
Thanks, Shane for the amazing video!!! I am having trouble refreshing the Gallery that's bound to the Activities Entity. Inside the gallery, I have control to mark items as complete. I am running the Patch function on the type of the object but as its' a polymorphic field, I have to call the Refresh Activities entity to see the latest result. Please suggest how I can work with polymorphic fields.
If you use collections, then instead of fetching all N records by simply invalidating cache (even using the method shown here to invalidate just a single time), you can instead patch a record in a list, and then patch/update your collection for just the single record that was patched. So if you get 473 delegated records out of 10,000, instead of just getting all 473 records again a single time, you can get just the single record that was modified instead.
I've used refresh once with a timer because client want a "real time" chat with teams direct from powerapps. I'm not sure is there is a better way to do it but for now it do the job. It scares me when lots of users enter the app and uses the chat at the same moment haha
Shane, this info was like an eeeeeeaarrly summer beer, very refreshing. Can you make this a series of videos about optimizations? Or perhaps not, I already got an early Christmas gift. ;) have a good one Shane and thanks.
I just saw this video, woow I was suprised that it was true haha I don't know why I even use it at this moment anymore. Most of the time I'm just adding records with a form and showing those records in a gallery. Thanks a lot this will improve my apps performance a lot!!
If you have more than one user modifying the same set of data in the same PowerApp app, the only way PowerApps will know of these other changes is for a Refresh() though, right?
Well explained Shane good simple explanation Hope Microsoft can fix it at some point. It is very similar to how notepad writes data of text files. It writes the data. Reads it, deletes it then writes it again and reads it back just to save data. That one is legacy though from when disk storage was unreliable. Happy holidays to you your family and team.
A possible sequel (or sequels) to this video might be what to do when doing *something* is needed in the particular scenario (unlike the one you showed) and what to do in those scenarios instead of refresh. Perhaps pick the Top 10 most common situations where nothing isn't an option for the desired functionality.
I can assume my scenario is the 1 of 100 where it can be used? I have buttons visible / not visible by permissions which are delegated by a users need to navigate to certain screens or not to have access. If a user currently does not have access and the manager needs to allow a user to that area while the person is in the app, the user will not see the button unless they completely log out. Thus I put a Refresh(SPList) that will refresh the info, thus giving them a visible button to be able to get to that needed screen.
I have my users patching a sharepoint and approver users who ackowledge and approve users submissions, the only option I know of is refresh (i'm a novice) to make the submissions appear for the approvers after the user patches them, is there a quicker way to do this? Like adding the whole sharepoint list into a collection on startup and then just patching the most recent 50 records or something to the collection when they refresh, would that work and would it even be quicker?
Hello shane I have an issue in my app I created sharepoint list and i put the title field as an Id auto increment in the power apps.. But assuming two users are in request page and the title shows #13 for both users so once the two users submitted in the same time in sharepoint it saved two records with same title So how the power app knows the other user is already submitted the request and the title should refreshed
This video talks about duplicates. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Ap3_Ea9H8b0.html Keep in mind the built in SharePoint Column called ID already handles your unique identifier. Could you maybe just use it.
Gracias Shane, me ayudo mucho comprender el error que tenia al refrescar las listas dentro de mis funciones concurrentes. Tienes un video que hable respecto al uso de funciones concurrentes o asíncronas sobre power apps?
I have a Gallery on one Page and the form for the gallery on the next page. In the Edit Form, I also have a custom DataCard along with the default ones, because of which I need to use both SubmitForm and Patch (for the custom datacard) for saving the data. The problem is , the data in my Gallery is not updated just for the custom datacard. It updates in the SharePoint list but not in the Gallery. The value only refreshes when I use the Refresh Function to manually refresh the data. What should I do?
So if you make a change in your data source, which in my case is SharePoint I don't need to refresh my data source in the App? So I make changes to my SharePoint list does the app automatically sync that data into the app? I just finished building my very first app so I am not familiar with how it all works.
Hi Amy - If you are changing the SP list from within Power Apps then, yes, the data in the app is refreshed. If you are changing the SP list using something else (like directly in the browser) then No, Power Apps doesn't know about the change, and you would need Refresh.
Hi Shane, I've tried not to use refresh, but if some other guy uses the app in another machine at the same time and change some data, I'm still viewing the old records in my screen. My scenario is: one screen to select one item in a combo box, and then I call the other screen sending an environment variable with the selected item. In the 2nd screen I have a form setting that enviroment variable within the item property. What do you recomend to always see the last updated data?
@@ShanesCows and how can I to get ride off the cache without loading the whole 100 first rows (when use refresh). After all I just need that PowerApps needs to ask for the rows it has to show.
How would someone refresh(update) the data source used to get the most recent info from List's in SharePoint when they select the item and navigate to screen 2 containing an edit form? I have tried refresh before resetting my varformdata and before navigating, but still, the data is old when on screen 2 edit form. It is not until I go back to homescreen that the info displayed is current.
Related question I can't seem to find an answer to: how frequently is data from SharePoint updated in an app? In other words, if there is a flow or other process outside the app that's updating the data, what is a realistic timeframe to expect the update to appear in the app.
So I know this video is 3 years old, but I thought I'd ask anyways. I have Galleries that are loading from SQL views. When I do a Patch() on the table, that view won't show it until I refresh. Am I forced to keep using views, or is there a better way?
After editing and saving the form, the data does not update unless you navigate away and then back to the screen with the form on it. After researching, I changed the Items property of the form from varRecord to LookUp('your datasource', ID=varRecord.ID) and that seems to work. I thought this might help everyone. Thoughts?
I keep getting etag conflict error even when I use or dont user refresh functions. I am doing a patch on each form and hence refreshing before a patch statement, still the error continues to be an issue for me.
I am using refresh for a dashboard situation where we want the dashboard screens at different locations to update at a specific interval without any user interaction. Is this a correct usage or should I be doing some thing else?
Hi Shane, what do you do on the case of a Gallery what is connected to a collection and the collection is changed via an edit screen. When you go back to the gallery screen the gallery is not refreshed?
I want to cancel a meeting on my App, after canceling it does not disappear instantly from the gallery, only when I leave the page and come back, does the canceled meeting disappear.
Thanks, Shane. Many of your Powerapps videos have been incredible useful for my own app building. I have hit a snag which I though Refresh might sort out but it has not. Have you come across the following scenario? I have created a Screen with an EditForm > made a changes > SubmitForm > ViewForm. The new changes are saved to the sharepoint datasource but do not show on the form (now in view mode) unless I go back to the gallery and reinvoke the form.
This usually only happens if your form or gallery is using a variable or a collection that you need to repopulate instead of referencing the data source directly.
@@ShanesCows Yes, that was it. Solved it using the LookUp function. Thanks. powerusers.microsoft.com/t5/Building-Power-Apps/Form-in-current-screen-not-updating-after-Submit/td-p/650664
Thanks for sharing. I have a flow which deleted records. Records are successfully deleted. I do a Refresh, but records still show for a few minutes. What will be the best solution in this case?
Hi Shane evertime I modify a gallery with editform the gallery doesn't refresh.. I need to exit app and launch it again.. Excel source file is updated but the browse gallery screen doesn't refresh? I can't use patch because I'm not adding a line to my excel file I'm only modifying the existing ones.. In the past it used to work even if it was a bit long to refresh that's true.. So how to refresh without the refresh function or patch function? We are actually 6 persons working with the at the same time, ! Thanks for your help
Hi Shane, What if the app is concurrently used by multiple users (Say 3-5)? This app has a gallery of items which an user can change and save. I want to update the changes that one user does in all other logged logged in user screens.
Hi Shane, I have a Powerapps Application based on an excel file in OneDrive. Excel file is refreshed with new data regularly (outside the powerapps application) but the application doesn't refresh when the file is updated while the application is already running. Do you have an idea how I could manage this issue? I used Refresh function but it doesn't work all the time.
Refresh would be your best option. I would also consider moving from Excel as a datasource. It isn’t the most robust and suffers from sharing and locking issues. SharePoint is the best free alternative
Does this also apply when using SharePointIntegration. By that I mean we've used PowerApps to build a custom form for a SharePoint list. When we update a List records, we use the Refresh on the SharePoint list to show the updated record in the list.
Excellent video, again! Suppose there are multiple users interacting with the same database through the app, and one of them modifies a record. Then the other one as he sees the record in the previous state, modifies that record again (without knowing his coworker already did), but in a different way. Hoy can I make the app keep up with the changes being made so this mistakes won't happen?
I use Refresh for checking if my data has changed outside my PowerApp. I do not like this solution so I was wondering how to do this in an other way. My data gets changed externally by a flow that picks-up a mail to a Team channel. The Flow then updates a SharePoint list, but I don’t think I can trigger my PowerApps app from within this Flow. (SignalR would be nice.) So I was thinking on updating a very small extra SharePoint List, with only a DateChanged field. So I can change this DateChanged List at the end of a successful Flow Run. Then I could check this small SharePoint List for changes with Refresh from within my PowerApp, and notify that the Data has changed. Without getting all the data from the main SharePoint List. But is there a better way to check if the data has been changed outside the app? Thanks for all the great video’s!
On Dataverse, when using a input search sort against a gallery, nothing shows up unless I write something and delete it all, then The whole list displays
How would you approach a scenario wherein multiple users submits a record using Edit Forms, but it doesn't show in your gallery. You probably need to refresh your browser or use a refresh function. Or is there any other way?
🙏 thanks but Shane if I use a view sql for my gallery show and patch the table that's on this view I need to reset gallery or refresh the view correct? Or do you have other trick 😎😎
Made the change. No longer using Refresh on a screens OnVisible. But now users can't see changes others make to a gallery unless they submit something to the gallery themselves... Do I fall in the 1%? Not a train smash, as it will be rare for a user to be putting the same thing into a Gal but non the less.
You would need a refresh to see other user's changes. Maybe give people a manual refresh button instead of just always triggering it? Also, if you read the other comments there are some neat ideas of ways to fake a refresh I keep meaning to try. But yes, you can just live it as is and I wouldn't tell Chewy to bite you. 😀
@@ShanesCows I was reading down in the comments and was going to ping you back and say, I'm good (since you answered this a few times) but you beat me to it. Thanks, Shane! I'll keep reading to see what nifty tricks folks are doing.
Dear Shane, I have just started with powerapps and your videos are so useful and clear. Is there a video where you show how to update multiple items in one go , for example in the native list environment you can select multiple items , click edit then just update specific fields in the form in one go (while leaving others as is). Id love to be able to do this in powerapps but can't work out how to do it.
Just got an idea on how to refresh just the gallery. Maybe it would work to add a boolean variable which you toggle with a timer. Then in the filter() formula you add a Or() formula which checks your variable to be true or false (which always returns true ofcourse). Because the filter() formula is changed the data is fetched from the datasource. I will try this out later today, but what do you think Shane would this work?
Was hoping that I had been doing it wrong and that there was an alternative. But I still need to use refresh as multiple people are using my apps. So I have it placed before patching and before opening records.
Sometimes it is necessary. My goal was to at least make it all make sense. I will say there are some other comments about using a fake patch instead of Refresh. I like this idea, but haven’t tried it yet.
Hey Shane. I have several use cases where multiple apps adjust the same datasets. Would it be possible (and more efficient) to use a reset function on the gallery to trigger a refresh on just those filtered items shown?
I had used refresh more than necessary; however, I have an app set up where I populate six SharePoint lists with default data when a new order has been entered so that the tables exist for the next entry form - SharePoint seems to choke without a refresh after each of patches, which i have set up to run after the initial entry and after the user clicks the submit button - any ideas on how to throttle the flow to SP so it doesnt freeze? I had a refresh after each and it seemed to work fast than without the refresh.
Hi Shane, great video. But I have one concern. I am using a collection which is storing the data source data and reading data from collection to avoid delegation issues. Now when I update,patch or remove something from my data source. The collection is still holding that data which is why am using refresh function and then collecting that again into collection. Is there any other workaround for this? Pls help
Good to know. I use collections mostly. I create a collection in appstart, or even a blank collection to get the schema of the DB source. I can update the collection and then patch the Collection to the DB at the same time. Notice my apps run real fast! Any downsides to this that you can think of?
@@ritabpedrosa I use collections, especially if I'm dealing with a smartphone app. I might be pulling in 3000 to sometimes even 10,000 plus records into the app and storing them in a collection then saving data to the device. So when the app loads on the smart device, it loads the data from the device back into the collection without a DB call. You do need extra checks and a DB setup to facilitate this and check and install updated and new records though.
@Shane Young is there a way to not use Refresh if the data is updated by power automate? The app i Have uses around 11 flows to update from external sources. I'd rather not use the refresh... or try to limit it?
@Shane Please reply to my question. Thank you you proved refresh is not needed in standalone app, but i want to tell you that it needed in sharepoint customized list forms. I will tell you why?... Basically if we are using a sharepoint list sidebar/popup window for opening a list form it loaded the value from cache and to refresh the value in the cache we need to refresh the data source otherwise we seen that it was showing values for different record which was opened previously or which is present in the cache. I don't know when Microsoft will resolve that issue, but we tried to open form in new tab and this way we don't have the cache issue. If you have any solution for not using cache while opening a form in sidebar/popup please let us know. Thanks.
Well, if you run a flow to run a sql server stored procedure AND using views as data sources I'm sure they won't refresh themselves. I haven't tested it yet (fairly new to powerapps) but based on what you said, since it's an outside change powerapps doesn't know about it.
Hi Shane, I have a situation where I edit an item from my gallery. Then I went back to the viewform of that item but it doesn't reflect the "Edited" fields it's still showing the old data. I tried refreshing the SharePoint data source but it doesn't help hmmm
If the update of sharepoint list is done by another app and I just need to be sure that the item is showing has the updated fields. The only way is doing refresh?
Hi Shane, this video is from December 2020, do we know if Microsoft has changed the Refresh behavior, or does it still act the same way? Love your video and enthusiasm when explaining 😀
Thanks - interesting to see the nerdy details behind the scenes. Just confirming - if you have a number of users that are frequently updating the same data source - refresh is still acceptable? I have an app which a number of users access and update at the same time - I have a timed refresh to make sure that each user gets the changes made by other users. Also interested in use of Fiddler. I've started using the PowerApps monitor recently to find bottlenecks and improve performance. Any views on that (Fiddler vs Monitor)? Might be a whole video on tracing and top performance improvements (hint hint).
Yes, on your refresh idea. As for Fiddler vs. monitor. That would be fun. Monitor still has some nuisance where it doesn’t show you the full truth. I tried to make this video with monitor and it left out stuff. So I went to Fiddler for the absolute truth.
but what do you suggest instead? i mean whenever one app user changes something in a list, that is visible in a gallery for another app user, it won't update for that user. He/she needs to reload either the app or do a refresh. (no signalr type of behavior as far as i see) how to do this then?
Hi Shane, awesome video. All your videos help me a lot. But I have a scenario that I import file by flow and then need to show for customer immediately. So should I use "refresh"
So I noticed if i use a flow to upload a document to a sharepoint library (thanks for the info from a past video btw) i needed to use refresh to get the gallery to display the uploaded document thumbnail and it was hit and miss! However if i stick a respond to powerapps at the end of the flow the app obviously waits for the flow to run and i no longer need to use refresh and gallery updates but all im passing back was the document identifier. Not sure why it refreshes the gallery, same reason you think? Thanks Shane.
I have 30+ users submitting new records, updating records, and patching in some cases as well throughout the course of a day, to my primary database. Without refresh, any record one user submits won't be visible to other users until after refresh - or have I been wrong about this the whole time?! O.O
Well if user A makes a update to the DB, user B wont have a clue the new record is there without a refresh. But how often should there be a fresh on the DB, especially if the dataset is big? You would need a timer option to do an auto refresh to check for new data.
@@AssassinUK Yes that's right. I have a timer set for 1 min. I get around the large slabs of data by putting images into another db, then using a lookup function to link the two databases together.
@@threewiseman1 no, you should be keeping all that data in one DB. When you pull the data in the 1st time you should limit the columns you want by using ShowColumns or DropColumns I think. If your keeping most the columns use Drop, otherwise use Show. This limits the data your bringing accross. You can then filter the same DB later to get the image and use ShowColumns just to bring over that image column only. Either way, no need to manage multiple DBs when you only need to manage one. 😉
@@AssassinUK Yeah, that is true, but there is another reason I split the data sources - my images need to be in unique columns, not attachments, and they are base64 strings that get uploaded to out blog site, as well as downloaded and converted into jpegs with specific names. It's complicated to explain, but it's working well.
Hi Shane... Very interesting video! One thing I have not been able to find (may not exist) is a "code view" of the app. In "the old days" I dabbled with VB4. One of the neat features was that you could dump the entire code of the application and its GUI and scan it for dumb or redundant stuff. Is there such a thing in Power apps? It would be nice to dump the code and search it for say uses of redundant variables or leftover testing code such as labels that are set to not visible (because they were used for testing as separate from being used behind the scenes legitimately)
Thanks so much! This was very helpful. I have been trying to figure out why Refresh seems so awful and clunky. Follow up question that some others may have. You said the Patch function invalidates the cache. When using a Form control, does a SubmitForm function call invalidate the cache as well? Thanks again and love your videos! I share them with my development team regularly.
Interesting. I guess I will use Fiddler like you did and see what’s going on under the hood of Power Apps and see if there are any differences in the traces when doing a submitform or a patch.Thanks again for the videos! Please keep them coming!
Chache invaludation is finicky sometimes. For example, video control works great when video in cache, but sometimes you have to wait for a minute till it loads (10 second video). And after you patch anything or refresh you have to do it again. One way I found is to call Flow to check on sharepoint and report back with values instead of refreshing. Is there a better way?
Hi Shane, great session. Thanks for sharing. My question is, how can I optimise working with a sharepoint list with many columns, of which I only need a few in my powerapp ?
@@ShanesCows Thank you so much. My scenario is that I want to have a gallery with only a few properties, and when I select an Item, I want to fetch and display all the other fields, and potentially update the selected record. Will the showcolumns option block me from accessing the other properties of the list ? As you recommend, I'm not using forms ;)
As always - great video! One question - what if I need to add some columns to data source? I presume I would just create a collection with AddColumns - but how do I make sure my collection refreshed when I update data record in the source? Thanks
If you change the data source from the app Power Apps will know. If you cchange the data source from outside Power Apps you will need to use Refesh unfortunately.
Hi Shane Young, First of all, congratulations on all your videos !!! I'm using Views from SQL-Server and I'm having difficulty, because sometimes it updates the data, but sometimes it doesn't update - which ends up generating an error. In this case, working with Views from SQL-Server, would it be necessary for me to use Refresh after Patch? or would there be another way to fix it? Thanks
Hi Shane and others. I would LOVE to not use the Refresh, however, the following code does not work without the last line, which is the Refresh. This code executes when the user clicks a button in the gallery, which sets "Archived" to true in the data source. Below this code is what Items code looks like. It appears that if the cache is invalidated, it should reload the gallery and not include items that have the Archived equal to true. However, without the refresh (on the button, after the patch) this does not happen, even though the data source is updated. The only difference between the Gallery not displaying the records that have been archived is this one line of code. Would really like to know why from Shane or anyone reading this. Until then my Refresh has to stay 😞 Button Code: Select(Parent); //Updates the delete flag Patch( FeeRequest, ThisItem, {Archived: true} ); //Set to first record Set(VarLastEditID,""); //Without this it does not remove the deleted record from the gallery Reset(RequestGallery); Items Code: If( varStatus = "In Progress" || varStatus = "Submitted", (SortByColumns( Filter( FeeRequest, UserGUID = varUserGUID And Archived = false And Status = varStatus ), "Created", Descending )), SortByColumns( FeeRequest, "Created", Descending ) )
Shane, Quick question on the gallery auto refresh. This seams to work great until the gallery items have a search or filter applied from a text input box. Then the auto refresh doesn't work at all. Have you noticed this, and if so, how do you get around it? Edit: It appears that the gallery uses the latest refresh when search is not applied, but uses different data when a search is applied.
Got the same issue here. Gallery with Excel sheet as data source, filtered as this: Filter(Employees, PPE_DONE = "false"). You're right, after lots of investigation it appears that the data retrieved after the cache invalidation come from some remote cache (or can it be local?) that has yet to be updated, while the Excel sheet is updated instantaneously. In other words what I get back is the same as before, and the item on the list that was treated is still visible when it shouldn't. If I trigger a refresh using a timer, it takes on average two minutes for the new data to show up. I tested without a filter and indeed the updated data shows up right away. Even when using the collection approach, ClearCollect behaves exactly the same: the data retrieved are the old data, not the new ones. Again, only after about two minutes will the new data show up using ClearCollect again.
@k1lg0re50 turns out this is an issue with too many rows being returned and powerapps is defaulted to only return 500 rows. You can't use the default form. You need to look into using collections. It's more work but it will get you what you want.
@@quadstardesign Thanks for replying. That's strange though because I'm in test dev/test phase and my sheet contains about twenty rows. Anyway, I implemented a collection for the list, and one to keep track of what to remove from the list. Ideally it would need more code to remove what has been removed from the remove list from the moment it's not in the refresh any more to avoid a "not found" error but I had enough of this, IfError(Remove(collection, removedCollection), "", ""); does the job fine blocking the error message, even though it's not very elegant...
Hi Shane, I was about to put refresh on my app at the start 🤣... i thought it was best since my app is a "live" purchase order status report... is it really a bad idea??
Hi Shane, Great video... Could you ask a question? From what I realized when I use a complex type column does he make a separate call to that column? So if I have 5 complex columns, will he make 5 separate calls? Also, you said that the refresh creates a cache just for him and is not used, why does this happen?
I haven’t made the video yet but is on the list. 🐶 Long story short? View forms do 5% of what edit forms do. Edit forms do 100% of what view forms do. So give me more flexibility
As ever, Great video Shane, I have learnt a lot from you over the past 6 months - thank you. I notice that if I use ClearCollect over a sharepoint list the collection does not refresh unless I use the refresh command on the sharepoint list first - which clearly from this video I want to avoid. Am I missing something here? Cheers Si
Reading through the comments below, I think this is already answered. If the data is changed outside of the app a refresh will be required. Someone mentioned a dummy patch, would be less overhead I guess..
@@davidgraf8012 The dummy patch is something we have debated here at PowerApps911. It looks like you would need to patch an existing record, with some random data, or patch a new record and follow it up with delete. Both options are faster than Refresh in most cases. training.powerapps911.com has different ways to get the monthly office hours. The curated library with office hours for $20 a month is the cheapest option. We also have 1 on 1 options available at www.powerapps91.com