cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MrParker
Level: Power Up

Does the PowerApps solution have capability for offline working

Hi all

 

Quick question regarding PowerApps. Is this a solution that can be used in an offline capacity? I.e. if there's no connectivity, can data to be submitted be cached / stored on a device until a connection becomes available?

 

 

Thanks

Michael

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Steelman70
Level 10

Re: Does the PowerApps solution have capability for offline working

I think so, there is a function (SaveData) that stores data locally. I guess you can use it while the connection is off. You can use Connection.Connected to check the status of your connection.

View solution in original post

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Does the PowerApps solution have capability for offline working

Kind of. As Steelman70 pointed out, there are a couple of functions - SaveData and LoadData - that allow you to persist some state locally while the connection is offline, and later you can push those changes to the server once the connection has been stablished again.

 

However, there's a lot of work that you need to do in your application to get it to work. For example, if we use the app created by the "App From Data" experience (a "master" browse page, a details page and an edit page), to enable offline you would need to do the following:

  • Create a collection for all added items, to call 'Collect' on the data source when it's back online
    • Change the 'OnSelect' handler of the 'confirm' button to, depending on the connection state, either submit the form or add the item to the collection
  • Create a collection of all updated items, to call 'Patch' on the data source when it's back online
    • Similar to the previous one, the 'confirm' button would need to account for the connection state
  • Create a collection of all deleted items, to remove once the data source is online; similar to the others, the button state would need to be updated
  • Update the browse gallery source to use a local collection instead of the data source directly (or a sort / filter / search function on that data source), so that added / deleted / modified items when offline appear 'immediately' for the app user
  • Handle conflicting edits to the same item: for example, if an item is added / then modified, ideally it should only be sent once to the server; if an item is modified / deleted, then there is no need to send the edits
  • Handle conflicts that may happen if multiple users update the same item at different points. If the app is online, then the user will know when the changes are being submitted that there is a conflict, and can resolve immediately

There are some other issues that will need to be addressed as well, but that gives a general idea of the complexity of making a real offline application.

 

Adding this capability (so that the app creators won't need to deal with that) is in the backlog. If you think this is a scenario you would need I suggest you vote up the item in the PowerApps ideas board, at https://powerusers.microsoft.com/t5/PowerApps-Forum/Does-the-PowerApps-solution-have-capability-for-....

View solution in original post

11 REPLIES 11
Steelman70
Level 10

Re: Does the PowerApps solution have capability for offline working

I think so, there is a function (SaveData) that stores data locally. I guess you can use it while the connection is off. You can use Connection.Connected to check the status of your connection.

View solution in original post

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Does the PowerApps solution have capability for offline working

Kind of. As Steelman70 pointed out, there are a couple of functions - SaveData and LoadData - that allow you to persist some state locally while the connection is offline, and later you can push those changes to the server once the connection has been stablished again.

 

However, there's a lot of work that you need to do in your application to get it to work. For example, if we use the app created by the "App From Data" experience (a "master" browse page, a details page and an edit page), to enable offline you would need to do the following:

  • Create a collection for all added items, to call 'Collect' on the data source when it's back online
    • Change the 'OnSelect' handler of the 'confirm' button to, depending on the connection state, either submit the form or add the item to the collection
  • Create a collection of all updated items, to call 'Patch' on the data source when it's back online
    • Similar to the previous one, the 'confirm' button would need to account for the connection state
  • Create a collection of all deleted items, to remove once the data source is online; similar to the others, the button state would need to be updated
  • Update the browse gallery source to use a local collection instead of the data source directly (or a sort / filter / search function on that data source), so that added / deleted / modified items when offline appear 'immediately' for the app user
  • Handle conflicting edits to the same item: for example, if an item is added / then modified, ideally it should only be sent once to the server; if an item is modified / deleted, then there is no need to send the edits
  • Handle conflicts that may happen if multiple users update the same item at different points. If the app is online, then the user will know when the changes are being submitted that there is a conflict, and can resolve immediately

There are some other issues that will need to be addressed as well, but that gives a general idea of the complexity of making a real offline application.

 

Adding this capability (so that the app creators won't need to deal with that) is in the backlog. If you think this is a scenario you would need I suggest you vote up the item in the PowerApps ideas board, at https://powerusers.microsoft.com/t5/PowerApps-Forum/Does-the-PowerApps-solution-have-capability-for-....

View solution in original post

powerappuser
Level: Powered On

Re: Does the PowerApps solution have capability for offline working

Carlos/Steelman, thanks for detailed info

Please see further questions below:

 

1. Is there any way to stop the app connecting to the internet by default based on connection status?

The end result should be that the app loads instantly if connection is not available instead of showing a loading spinning circle.

 

2. Please give an quick example of an offline app that uses Common Data Model.

Unsure if any offline sync functionality comes with CDM.

 

3. When could the official offline functionality be expected?

 

 

Help and clarifications are always appreciated.

yukonn
Level 8

Re: Does the PowerApps solution have capability for offline working

Hi,

 

       Carlos/Steelman said we can use "SaveData" for Offline Mode. But your SaveData will be lost when you update with latest App from PowerApps of your organization. The reason is PowerApps always delete the existing App Folder and download from Server. That why your SaveData is lost after update with latest App. So SaveData is good to use for offline mode if they can solve it this issue. I was reported 1 month ago but still has this issue on latest PowerApps.

 

Regards,

Steelman70
Level 10

Re: Does the PowerApps solution have capability for offline working

Hi yukonn, thanks for pointing this out.

hpkeong
Level 10

Re: Does the PowerApps solution have capability for offline working

Hi

 

May I have additional suggestion to Mr. Parker?

- Use SaveData (which is to a temporary location) and at the same time, use EXPORT to save to XML (in zip format. Though you pre-set the filename, you can still change to whatever filename you wish and save!)

 

So, even when changes are made to PowerApps edition, XML file is always residing in our local drive, self-defined filename and can be IMPORTED back at any time.

 

I have developed Bed Time Story Books and available in Windows Store (using Project Siena, Windows 8.1, 2 years ago), using SaveData / LoadData and Export / Import. You may to this as a reference.

 

Screenshot (1).png

 

Hope this helps.

 

 

hpkeong
stickmancan
Level: Power Up

Re: Does the PowerApps solution have capability for offline working

Is there anything resembling a potential delivery date for the straightforward creation of PowerApps that work offline without the creator requiring the technical expertise you outline in your extremely helpful post please? If not what can I do in order to get this functionality bumped up the priorities list please?
Highlighted
Meneghino
Level 10

Re: Does the PowerApps solution have capability for offline working

Hi @stickmancan, have you seen this?

https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

 

Offline work is necessarily somewhat technical as you need to decide how to deal with conflicts between offline data and server data.  Which source should prevail etc.

stickmancan
Level: Power Up

Re: Does the PowerApps solution have capability for offline working

Thank you for the steer. It is greatly appreciated and good to know that offline capabilities are reasonably high on the list of priorities. Thanks again.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,797)