Showing results for 
Search instead for 
Did you mean: 

Make SaveData() and LoadData() more robust against disaster scenarios

Currently, SaveData() and LoadData() work on mobile, but they have limitations that do not account for data safety and recoverability on disaster scenarios. 


It is impossible to sideload, access, backup or restore SaveData(), likely by design. (at least on an unrooted platform)


Consider the scenarios: 


1) App that collects information when offline for extended time periods due to work conditions. (no wifi/4G on remote areas)

2) Data is unique, impossible to replicate, or would be impossibly expensive to do so.


Consider the disaster scenarios: 


1) App lost power mid-write, corrupted SaveData

2) Device ran out of space 

3) System cleanup action used Android-provided "Clear Data" on PowerApps by automated cleanup or user mistake

4) PowerApps binary got corrupted or uninstalled by accident

5) Device was factory reset

6) Device broke down


Currently, there is no way to recover SaveData() from any of these scenarios. 


I propose the ability to increase recoverability on all these fronts with the following: 


1) App would be able to save an encrypted copy of SaveData() on another location: 

a) sd card when available

b) Cloud Drive folder location (Google Drive, OneDrive, iCloud, etc)

c) to keep it simple and predictable, a folder structure PowerApps/AppName, or PowerApps/AppID should be used to store the recovery data. 


2) App creator would define the security of  SaveData() encryption:

a) Only user that created it (UPN) can restore; OR

b) any user or group with permission to the App may restore


3) Backup copy of SaveData() may be copied back to the same location on a different device, or on the same device after it has been restored.


4) LoadData(LoadMode.Mode) would get additional optional parameters to load data from secondary backup: 


5) LoadMode.Mode can be some value from an enumeration: 

a) LoadMode.Default - the default, current behavior

b) LoadMode.Restore - instead of loading from whatever may exist in the primary Daved Data, loads from the Restore location.

c) LoadMode.FullRestore - loads from the Restore location and saves to primary location in one go. 


5) SaveData will get an additional optional parameter as well.

a) SaveData(data, location, "SaveToRestoreLocation" = true|false). If set to true, after the SaveData executes, it saves the backup. 

b)SaveData(true) and/or SaveData({SaveToRestoreLocation: true}) without other parameters should pick up whatever was saved by SaveData previously, and make a backup.



Status: New
Helper IV

If I understand it correctly, it would be great.

This Idea plus:


New Member

Estoy totalmente de acuerdo con la propuesta.