Today I’m having a look at some of the preview features arriving in Power Apps. This post is about the new LoadData, savedata and cleardata in web players feature.
SaveData, LoadData and Cleardata
LoadData, savedata and cleardata have been around for a while, but up to now they were only available within the app player. As they were only available in the app player you could use it oin your mobile but not within the browser where a lot of our users use our apps.
So you can now enable the preview features called Enable SaveData, LoadData and ClearData on web player to make this also available within your browser.
There are whoever a few limitations.
As this example shows I can get an app to remember for settings the next time the app loads as i’m setting the background and then reload the app with the background set.
All I needed to do is configure my 3 buttons to set the colour of the background of my screen, then save the collection that holds my background.
Then the background of the screen is set using the following code:
And finally the onstart of my app is set to load the data back in using:
LoadData(colBackground, "MyCache", true) So nothing too complication.
So far I found the following limitations:
- The Load Data and SaveData can only handle collections. So you might end up with single item collections rather than objects.
- The Data functions now work in the web player but they don’t work in the development studio. Aaahhh.
- The SaveData is limited to 1MB of data
- The data is stored within your browser’s local storage. For data that needs to be secured, you migth want to find other options.
2 thoughts on “Loaddata, Savedata and Cleardata in Power Apps”
I’ve been reworking my app for the past 3 days to figure out a workaround for this. I only wanted to save/load data when the user is in the Power Apps windows desktop app, but not when they’re using the web player. All those hours (potentially) wasted and this experimental switch may be just what I needed, thank you Pieter.
Sorry for not writing this post 3 days ago. If you ever struggle with something in the future just let me know. I’m always happy to help.