Auto-refresh data in Power Apps

Auto refresh data in Power Apps

Auto-refresh data in Power Apps

By:

Date:

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

I’ve created an app that uses the Accounts entity in my CDS as a data source and Accounts are being displayed.

Gallery displaying accounts from the CDS

My app has a form to add new accounts to my database.

Adding a record to accounts using a form

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

The gallery is not updated

Auto-refresh data with timer

To solve this issue I’m adding a timer to my screen displaying the gallery of accounts.

Auto-refresh data with timer

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.

added an item

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.

Now the gallery is updated after a while

Is your business still running on paper trails, sprawling Excel files, or ageing Access databases? There’s a better way — and I can show you exactly what it looks like. I’m the Technical Director of Vantage 365, a Microsoft solutions consultancy working with clients across the UK, the Netherlands, and worldwide. For over 30 years I’ve been turning messy, manual business processes into clean, automated systems that save time, reduce errors, and give teams the visibility they need to make better decisions. SharePains is not just any blog run by a Microsoft MVP. Have you ever used Try-Catch in Power Automate? The original post about Try-Catch in Power Automate can still be found on this site, https://staging.sharepains.com/2018/02/07/try-catch-finally-in-power-automate-flow/ Or have you ever used the Pieter’s method to avoid variables and speed up your flows? https://staging.sharepains.com/2020/03/11/pieters-method-for-advanced-in-flows/ You can contact me using contact@staging.sharepains.com

Leave a Reply

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