When you use galleries in Power Apps to display data from a data source you will need to consider refreshing data. As the data is updated by other users you might want to auto-refresh your data. This post described a pattern for this.
Display accounts in an app
Table of Contents
I’ve created an app that uses the Accounts entity in my CDS as a data source and Accounts are being displayed.
My app has a form to add new accounts to my database.
This all is great when I’m the only user, however when there are multiple users you might run into some refresh issues.
As one app instance adds a new account the other users will not see this new item
Auto-refresh data with timer
To solve this issue I’m adding a timer to my screen displaying the gallery of accounts.
On the timer you will need to set the Auto Start and Repeat and set the OnTimerStart as shown above. this will load the data in a MyData variable. Now update the Gallery to use MyData instead of the Accounts data source.
Now as one user adds a new record.
After a while you will find that the gallery in both instances synchronises. To control the refresh rate of your app you could consider some of your timer settings.