I have gone back to basics and recreated this simple app. (link)
Button Codes:
Collect -
Collect (LocalStorage, {Fname:txtFName.Text, Lname:txtLName.Text})
Clear -
Clear(LocalStorage)
Save -
SaveData(LocalStorage,"saveLocalData")
Load -
LoadData(LocalStorage,"saveLocalData")
The LoadData() only seems to work on:
Windows 10
Windows 10 mobile
iOS
When I try this on Android nothing happens.
I cant tell if its SaveData() or LoadData() not working.
Android Version: 8.0.0 (Oneplus 5) & 7.0 (Samsung XCover 4)
PowerApps Version: 3.18043.21
Session ID: e14f5a69-a3b0-4b42-ae6a-26a550859e3e
Solved! Go to Solution.
@AlanCossey I have just re-tested my offline app and it seems to work. try testing with my attached app (import it)
version: 3.18111.14
android:
7.0
8.1.0
9
Afternoon,
I can confirm that an app that is currently live in our business has the same issue, that the save / load data functionality does not seem to be working on Android (V7.1)
I have done the same as @kdtc and produced a basic app and seeing exactly the same results.
Would it be possible to get an update on this please?
Thanks in advance,
Jason
Same issue here - works on IOS, no dice on Android (7 or 8 tested).
I'm still getting this on Android 7.0 (Samsung Galaxy S6). PowerApps was updated on my phone on 8th November 2018 (version 3.18111.14).
@AlanCossey I have just re-tested my offline app and it seems to work. try testing with my attached app (import it)
version: 3.18111.14
android:
7.0
8.1.0
9
Thank you ever so much for this. Yes, it works on my machine so the problem with my app must be my design. I'll let you know what the problem was when I find it (if it isn't too embarrassing ).
Thanks for showing me that SaveData and LoadData work OK. However, I still have a problem in that, if the connection is OK, I want to get the data from a connection to Azure SQL, save it to local storage and then load it into a gallery. (If the connection is not OK I would just load into the gallery from local storage straight off.)
It looks like my actual problem is to do with loading the gallery, rather than LoadData or SaveData. If I set the Items property of the gallery to a data connection I have to an Azure SQL source (dbo.vwSummary) I can see details of the records OK.
To do the equivalent of your creation of a collection I have a button whose OnSelect property is "ClearCollect(cnLocalData,'[dbo].[vwSummary]')". To check that this works OK I have set a gallery's Items property set to "cnLocalData" and all works well using studio. There, if I run the app, the gallery is initially empty, but clicking the button fills it with data. I have a second button which clears the collection OK and clicking the first one again refills the gallery OK. Life is good ... until I publish it and the gallery won't get filled either running the app in the browser or on my phone when I click the first button.
Your sample app works fine on my phone in that it creates a collection from data that is entered manually on the phone, but I am after a (read-only) app showing data from Azure SQL which will work offline.
The app is weird. If I use the full code needed to use local storage, the first button becomes
ClearCollect(cnLocalData,'[dbo].[vwSummary]');SaveData(cnLocalData,"lstLocalStorage");LoadData(cnLocalData,"lstLocalStorage")
This is intended to be along the lines of https://powerapps.microsoft.com/en-us/blog/implementing-offline-capability-in-your-app/. I am definitely logged in on the phone as the same user as in Studio. I realise that this will not work in a browser (due to LoadData and SaveData not working there), but surely it should on my phone.
Does anyone have any idea why I can't fill the collection and show data in the gallery from that collection when using the browser or my phone whereas I can in studio, please?
It's driving me nuts.
@AlanCossey Unfortunately I haven't worked with pulling in data from an Azure DB source yet, so my help may be limited, but I can help troubleshoot to find the root of the issue.
When running the app in a browser shouldn't prevent the app from working at all, you will just require an active internet connection.
First, when I load an app I check the connection first then create my collections based on that. Using your example it would be something like:
If( Connection.Connected, ClearCollect( cnLocalData, '[dbo].[vwSummary]' ); SaveData( cnLocalData, "lstLocalStorage" ), LoadData( cnLocalData, "lstLocalStorage", true ) )
At this stage, I would continue by uploading an excel export of '[dbo].[vwSummary]' from your Azure db as static data onto your app. Using the static data do you get the same results?
Also, test an app auto-generated from the data source.
Hiya,
I tried doing those two things and it works with Excel. Sort of. Sometimes.
When I then swapped back to using Azure SQL as the source it worked offline. Great... for a bit, then stopped. I reverted to Excel and it worked, sort of... some of the fields, but not all.
It's too flakey. Thanks for you help here. I will need to revert to using it with no offline capabilities for the time being and will have a look at it some other time if I get the time. If I get anywhere I'll let you know.
User | Count |
---|---|
196 | |
124 | |
88 | |
49 | |
42 |
User | Count |
---|---|
284 | |
163 | |
138 | |
75 | |
72 |