cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
timblizard
Level: Powered On

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.

 

Tim

1 ACCEPTED SOLUTION

Accepted Solutions
PierreJoubert
Level: Powered On

Re: SaveData not working on iOS with PowerApps V3.19044.15

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: https://powerusers.microsoft.com/t5/General-Discussion/500-item-limit-in-CDM-entity-search-filter-ne...

8 REPLIES 8
PowerApps Staff sriniD
PowerApps Staff

Re: SaveData not working on iOS with PowerApps V3.19044.15

@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"))

timblizard
Level: Powered On

Re: SaveData not working on iOS with PowerApps V3.19044.15

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.

PierreJoubert
Level: Powered On

Re: SaveData not working on iOS with PowerApps V3.19044.15

Hi

 

We are experiencing the same issue on V3.19053.21 

 

Have you been able to resolve this?

 

Thanks

Highlighted
PowerApps Staff sriniD
PowerApps Staff

Re: SaveData not working on iOS with PowerApps V3.19044.15

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

PierreJoubert
Level: Powered On

Re: SaveData not working on iOS with PowerApps V3.19044.15

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

PowerApps Staff sriniD
PowerApps Staff

Re: SaveData not working on iOS with PowerApps V3.19044.15

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?

PierreJoubert
Level: Powered On

Re: SaveData not working on iOS with PowerApps V3.19044.15

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: https://powerusers.microsoft.com/t5/General-Discussion/500-item-limit-in-CDM-entity-search-filter-ne...

PowerApps Staff sriniD
PowerApps Staff

Re: SaveData not working on iOS with PowerApps V3.19044.15

@PierreJoubert happy to hear that issue resolved.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 4 members 4,845 guests
Please welcome our newest community members: