Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

SaveData not working on iOS with PowerApps V3.19044.15

I've built a PowerApp to run offline on an iPad. I create entries in a Collection (called HEAP) then use SaveData(HEAP, "HEAPCache") and LoadData(HEAP, "HEAPCache", true) to persist. SaveData is called when a "Close" button is selected as well as each time a new item is added to the HEAP collection. LoadData is called in the OnStart event.


I haven't been able to get this to work between restarts of the application so I tested during a single. Each time a new item was added to the collect I would SaveData(HEAP, "HEAPCache"); Clear(HEAP); LoadData(HEAP, "HEAPCache", true). As expected this would cause the attached gallery to flicker as the HEAP collection emptied and reloaded. But this proves that SaveData/LoadData work with a single execution of the PowerApp. Nevertheless, the data is not persisted between restarts.


Please help.




Accepted Solutions

Found a resolution to the issue, it seems the way the offline data was been saved and how the information was been retrieved from CDS was causing the problem.


This post here resolved my issues:

View solution in original post

Power Apps
Power Apps

@timblizard Purpose of the SaveData is stores the data on the device disk and LoadData is loads the data which already stored on the device. This calls are always persistent. SaveData alway overides the existing data, means always replaces existing saved data with new data. Suppose if you try to call SaveData with empty collection, it will clears existing save data and saved as empty file. In your case, can you might be saving the empty collection before closing the app that results there is no data in loading while app startup. Please check if you are hitting such case in your app. Otherwise you can extra check in your expression
If (CountRows(HEAP) > 0, SaveData(HEAP, "HEAPCache"))

Thank you for your response but this does not address my issue. I understand that the intent of the SaveData/LoadData functions is to provide persistence of a collection across restarts. However this is not working for me on my iPad.


To verify that your supposition is incorrect, I have added the following buttons to my screen:


Count = Notify(Text(CountRows(HEAP)), NotificationType.Information)

Save = SaveData(HEAP, "HEAPSave")

Clear = Clear(HEAP)

Load = LoadData(HEAP, "HEAPCache", true)


As I said in my original post, I have a gallery that uses the HEAP collection as a data source. So if I have added (by a button on my screen) a record to HEAP then it displays in the gallery.


Now if I try the following sequence of button presses having just started the app and the gallery showing no records:


Count (resulting notify message = 0)

Add record to collection HEAP (record displays in gallery)

Count (resulting notify message = 1)

Save (should save the single record to HEAPCache file)

Count (resulting notify message = 1)

Clear (record displayed in gallery is removed indicating that the HEAP collection is now empty)

Count (resulting notify message = 0)

Load (should reload the original record from the HEAPCache file but nothing is displayed in the gallery)

Count (resulting notify message = 0 indicating that no record was loaded from the cache)


The above sequence was performed withini a single execution of the app and clearly demonstrates that persistence is not working for some reason. Please advise.



We are experiencing the same issue on V3.19053.21 


Have you been able to resolve this?



@PierreJoubert  Can you explain what exactly doing here? If better provide some repro steps to help resolve it soon for you.

The data is not persisted to the device between starts... same as the issue described originally... and it is on iOS...

Original issue got fixed, there is issue in app. Because we are not seeing any issue here related to persistence.  Can you share us repro app thru private message?

Found a resolution to the issue, it seems the way the offline data was been saved and how the information was been retrieved from CDS was causing the problem.


This post here resolved my issues:

View solution in original post

@PierreJoubert happy to hear that issue resolved.

Helpful resources

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users


We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (43,442)