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 / Power Apps SaveData() ...
Power Apps
Unanswered

Power Apps SaveData() Cache not always Saved

(0) ShareShare
ReportReport
Posted on by 7

Hello,

 

We have implemented basic offline functionality into an app we are testing with the following OnStart function from the tutorials:

 

Set(Var,"N");

If(
Connection.Connected,
ClearCollect(xxxx,'xxxx'),
LoadData(xxxx,"xxxx",false)
);
SaveData(xxxx,"xxxx");
Set(Var,"Y")

 

Which works as expected and we can store records locally and submit them when reconnected. However we were running into an issue where the cache was not always saved. We were wanting to use the Set variable to display when the SaveData() had finished and the app was safe to close as our intended users will only use the app occasionally and frequently will start it up out of signal range and we wanted to be confident the cache was available so they would be able to use the app on site.

 

If I close the app and go offline as soon as the variable changes it never has the cache saved, but if I wait a further 10-20 seconds and do so it seems to save 100% of the time. Is there some way of instead checking if the SaveData() cache exists directly? At least a "if you go offline now you will be able to reopen the app again" since reopening PowerApps to an empty list is very frustrating. Given our users' situation we would like to be absolutely certain they will have access to the app out of signal.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,460 Most Valuable Professional on at

    Hi @MOldfield ,

    Try this structure - I have put some names in to show the item being actioned

    If(
     Connection.Connected,
     ClearCollect(colYourSaved,YourDataSouce);
     SaveData(YourCache,colYourSaved),
     LoadData(YourCache,colYourSaved,true)
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • MOldfield Profile Picture
    7 on at

    Thank you for your response.

     

    I've quickly dropped it in and it doesn't seem to have changed anything, if I go offline after the variable changes it still doesn't have the SaveData() and like before I still have to wait for a period of time to guarantee that I can open the app offline. I don't see why having the SaveData() inside the if true would change anything instead of doing if true and having SaveData() immediately afterwards.

     

    I was just hoping that there would be a way for me to check if the SaveData() cache exists directly.

  • WarrenBelz Profile Picture
    156,460 Most Valuable Professional on at

    Hi @MOldfield ,

    There is no way to check other than to load it while offline. I assume you are checking this on a mobile device - also how many records does your data list contain?

  • MOldfield Profile Picture
    7 on at

    Yeah, we would have liked to use the IfError() function with the loading to check if it was in place but it doesn't seem to work reading other posts here. If it's something that can't be done then we might just have to stick to an arbitrary timer.

     

    Yes, we're checking on a mobile device. Right now it's only got a handful of test items but users won't be editing or interacting with items, just creating new ones.

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 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard