cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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.

 

Tim

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

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...

View solution in original post

8 REPLIES 8
Highlighted
Power Apps
Power Apps

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

Frequent Visitor

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.

Highlighted
Frequent Visitor

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
Power Apps
Power Apps

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.

Highlighted
Frequent Visitor

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...

Highlighted
Power Apps
Power Apps

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?

Highlighted
Frequent Visitor

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...

View solution in original post

Highlighted
Power Apps
Power Apps

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

@PierreJoubert happy to hear that issue resolved.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,235)