cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
charafRef
Level: Powered On

OFFLINE MODE from SharePoint List

Hi all , 

I have a SahrePoint Lists witch i build my powerapps application for our compagny. I read all this post about offline mode : 

 

OFFLine Mode :

https://powerusers.microsoft.com/t5/PowerApps-Forum/Unable-to-create-an-Offline-Capable-App/m-p/5243...

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/PowerApps-with-SQL-server-connection-Offline/

 

https://powerusecom/t5/PowerApps-Forum/Does-the-PowerApps-solution-have-capability-for-offline-working/td-p/4679

 

https://powerapps.microsoft.com/fr-fr/tutorials/function-savedata-loaddata/

 

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

 

But , i don't really catch how to get it. My goal it's very simple. i"m looking to use the apps on offline mode without patch , load or something else. My users will just reading the information on my apps No edited items ll'd adding , no update , Juste running apps while being offline. 

 

Someone have a very clear steps with a concrete example ? 

 

All helps will be appreciate , tnx Communuty.

9 REPLIES 9
Community Support Team
Community Support Team

Re: OFFLINE MODE from SharePoint List

Hi @charafRef,

 

The current logic for offline App requires the App has been connected Online (with the data source ) at least once.

Which means that if you would like the App to be able to work offline, there should be a local copy of the data saved in the mobile device (when online earlier).

 

If this is acceptable, then you may consider take use of the offline defined in the blog you mentioned.

 

Regards,

Michael

 

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
charafRef
Level: Powered On

Re: OFFLINE MODE from SharePoint List

How to make a local copy data ? and  do you have another example cause this one isn't clear for me ? 

 

 If(Connection.Connected,
      ClearCollect(LocalTweets, Twitter.SearchTweet("PowerApps", {maxResults: 100}));
      UpdateContext({statusText: "Online data"})
      ,
      LoadData(LocalTweets, "Tweets", true);
      UpdateContext({statusText: "Local data"})
  );
  LoadData(LocalTweetsToPost, "LocalTweetsToPost", true);
  SaveData(LocalTweets, "Tweets")

best Regards , tnx

 

Highlighted
charafRef
Level: Powered On

Re: OFFLINE MODE from SharePoint List

Hi again to all ,

 

Someone have a simple example how to build offline mode , cause the Twitter example of Carlos Figuiera

doesn't help me , the article is not clear as well. We need some helps how to build an offline apps from SharePoint List ? 

@v-micsh-msft , @Meneghino , @CarlosFigueira ? 

 

thanks for your help in advance ! 

 

 

Super User
Super User

Re: OFFLINE MODE from SharePoint List

What sort of data are we talking? Tables? Website?

 

1st step: Collect(Name,data_source,criteria)

Name: a name you want to store the data under

datasource: the table name for instance that you have added under datasources

criteria: ie: if you wanted to filter table by ID then it would be Filter(table,ID = some number)

 

If you want to clear out any previous data the use ClearCollect instead of collect

 

2nd step: Savedata(Name,"Name")

Name: the collection name above

"Name": i would keep this the same but you can save the data under any name you want

 

Now when you load the app set your onstart property to

Collect(Name,data_source,criteria);SaveData(Name,"Name");LoadData(Name,"Name",true)

Set your datatable or form or gallery items property to: Name

 

How this is set up is: it will load the app, import any data, save the data, reload the data, so that your form/gallery etc will show it

 

If you change to ClearCollect then any previous data would be wiped before it inports anything further.

 

Thats the simple explanation, but there is so much you can alter and add such as conditional statements.

 

 

 

 

charafRef
Level: Powered On

Re: OFFLINE MODE from SharePoint List

@Delid4ve

Great , it's more clear for me now.

But still doesn't work for me  i unerstood why ! i'm using a web studio  , i can't import Colelction , save and load Data. i don't have access on Windows 10 on this moment. 

 

Tnx for your reply and your time.

Anonymous
Not applicable

Re: OFFLINE MODE from SharePoint List

Hi ,I need bit of help regarding offline mode using sharepoint , I have tried everything but the local cached data is not getting updated in sharepoint when the app is getting reconnected to internet , though it doesn't shows any errors. Offline data not getting updated in sharepoint. Below is my code, Pointer : When user is offline and trying to make a new entry his record is being saved in Collection "LocalUpdatedRecords" and when he regains the internet connectivity the records should be updated in sharepoint list "Offline test" .I have tried Using Patch ,Update ,Collect etc but nothing seems to update the records in sharepoint, any suggestions will be highly appreciated. Thanks in advance. If(Connection.Connected && CountRows(LocalUpdatedRecords)>0, ForAll(LocalUpdatedRecords,Patch(OfflineTest,Defaults(OfflineTest),{FirstName :lbl_FirstName,LastName:lbl_LastName,Age:lbl_Age,Mobile:lbl_Mobile})); Clear(LocalUpdatedRecords); SaveData(LocalUpdatedRecords,"LocalUpdatedRecordsToBeAdded"); Refresh(OfflineTest); ClearCollect(OfflineData2,OfflineTest); SaveData(OfflineData2,"LocalCachedData")); Navigate(BrowseScreen1,ScreenTransition.Cover)

Super User
Super User

Re: OFFLINE MODE from SharePoint List

Try using UpdateIf, ive found patch doesnt work reliably. 

 

I see SaveData entries, however no LoadData entries..

SaveData and LoadData ONLY save data into the local devices cache.  If you want to use that data you HAVE to load it back into a collection first.

 

So i could:

Collect sharepoint list to collection A

SaveData A to "A" (this now allows me to exit/close the app)

I now reopen the app

LoadData "A" to A (this puts that saved data back into collection A (which should already be empty as we closed the app)

now i can update it back to sharepoint.

 

have you tried these formulas individually..

Collect the sharepoint list, make a change, patch it back, check it works..

Collect the sharepoint list, savedata, exit the app, loaddata, see the collection is populated again..

 

You can check these by just putting 2 datatables on your opening screen linked to the collection and the sharepoint list so you can see it populate with the new values, and have the two formulas on a couple of buttons.  I usually have a seperate screen for testing which i can delete once ive finished the app, helps you to see whats going on. 

 

so for me, to save overcomplication, i do the following:

1: App on start property: loaddata into collection "A", check if there are records in collection "A" (rowcount), if true then dont collect  sharepoint list, if false then collect sharepoint list and then savedata

2: work purely on the collection and forget the sharepoint list altogether now.

3: on your form, everytime you update the collection make sure you savedata stright after it.

4: you can quit the app as much as you want and all your data will always be there now.

5: have an upload data/merge changes button which will update the sharepoint list with your collection data, then clear the collection, savedata

6: now when you reopen the app, the collection wont have any rows so it will load the sharepoint list.

 

i found connection.connected to be too unreliable, what happens if its dropping in and out constantly, half updated records etc, button much better.

you can also add a formula in before you clear the data to check all changes were updated before you clear it out (incase of flaky internet)

 

AlexN
Level 8

Re: OFFLINE MODE from SharePoint List

In addition, please keep in mind that offline data doesn't work when used in browsers (either in player mode or in powerapps studio). It only works in the PowerApp app on mobile phone and in the PowerApp desktop app.

Anonymous
Not applicable

Re: OFFLINE MODE from SharePoint List

Hi, Thanks for your reply.

I tried all the above methods , still my sharepoint list is not getting updated with the offline data after re connecting to internet, as you said offline feature won't work for web, I tried in mobile app, still facing the same issue.

Please if you have worked on offline feature can you share me the code, it wll be very helpfull.

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 68 members 3,494 guests
Please welcome our newest community members: