web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to use LoadData an...
Power Apps
Unanswered

How to use LoadData and IfError to maximize offline use and speed up the app OnStart

(1) ShareShare
ReportReport
Posted on by 57

I have read a lot about how to use LoadData and SaveData to make my apps work offline. This is a great feature! 

I found that if data is saved to the device, and I am offline, the app loads up SUPER quick! Unfortunately, while online, it would still do the normal collections, and the app would load slowly.

I would love to have the app identify if there is data stored in cache, and if there is, load that instead of collecting the data from it's original data source.

There didn't seem to be an easy way to take advantage of this, that I could find doing a quick search, so I figured I would share the super easy solution I stumbled upon.

 

Using IfError, we can take advantage of the error that is generated by the LoadData function.

 

Example of what would be in OnStart:

If(Connection.Connected,

IfError(

LoadData(colCollection, "savCollection", false), 

Collect(colCollection, DataSource);

SaveData(colCollection, "savCollection")

),

LoadData(colCollection, "savCollection", true)

 

When no data is found in local cache, collect from the data source (and save the data to cache). When data is found in cache, collect from the cache! This greatly speeds up AppOnstart.

 

Considerations: Only use this method for data that you don't expect to change often. If the data changes often, you may need to come up with a synchronization schedule or an ability for the user to manually refresh the cached data.

 

If anyone has a better solution, please share!!

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard