cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Water
Regular Visitor

Save LocalCache on application exit

Hello all,

 

I am currently using the Offline capabilities of PowerApps to create new items in a SharePoint List. It looks very promising. I am following this : https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

 

However, there is a problem. If I have 3 pending uploads, and I exit the app, they are gone the next time I open the app. I was hoping if I could somehow keep it on a persistent state until it is sure that they have been uploaded to the SharePoint list.

 

Is there a way to save the localcache on app exit?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi Water,

 

If you have only 1 pending upload, can you see the data the next time you open the app in offline mode?

 

From the blog we know that in offline mode, we can load data from a local cache using LoadData function, then when we change to online mode, we will be able to upload the data to data source.

 

Best regards, 

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yamao-msft
Community Support
Community Support

Hi Water,

 

If you have only 1 pending upload, can you see the data the next time you open the app in offline mode?

 

From the blog we know that in offline mode, we can load data from a local cache using LoadData function, then when we change to online mode, we will be able to upload the data to data source.

 

Best regards, 

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mabel,

 

Thanks for that. I have missed the initial LoadData on the OnVisible of the screen.

 

Now it is loading the pending uploads even after I exit and reopen the app. Works perfectly. 

 

I also solved why it is always Pending Upload : 1 . On TimerEnd, it was saving the txtTitle textbox after it clears. I removed the savedata and now properly showing the number of pending uploads.

 

Thanks!

 

EDIT:

 

As a follow up question, is there a time duration / expiry of the LocalCache? Or exists indefinitely until it gets posted?

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,247)