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

LoadData/SaveData Not Working On Android

 

I have gone back to basics and recreated this simple app. (link)Screenshot_20180427-121806.png

 

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

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
kdtc
Level: Powered On

Re: LoadData/SaveData Not Working On Android

There has been an update on the android store which seems to have fixed this problem.

View solution in original post

kdtc
Level: Powered On

Re: LoadData/SaveData Not Working On Android

@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

View solution in original post

9 REPLIES 9
JayDee
Level: Powered On

Re: LoadData/SaveData Not Working On Android

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

JeffSmith215
Level: Powered On

Re: LoadData/SaveData Not Working On Android

Same issue here - works on IOS, no dice on Android (7 or 8 tested).

 

 

kdtc
Level: Powered On

Re: LoadData/SaveData Not Working On Android

There has been an update on the android store which seems to have fixed this problem.

View solution in original post

AlanCossey
Level: Powered On

Re: LoadData/SaveData Not Working On Android

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).

kdtc
Level: Powered On

Re: LoadData/SaveData Not Working On Android

@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

View solution in original post

AlanCossey
Level: Powered On

Re: LoadData/SaveData Not Working On Android

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 Smiley Happy).

Highlighted
AlanCossey
Level: Powered On

Re: LoadData/SaveData Not Working On Android

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.

kdtc
Level: Powered On

Re: LoadData/SaveData Not Working On Android

@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. 

https://youtu.be/CO6xfbjnYwc?t=1437

AlanCossey
Level: Powered On

Re: LoadData/SaveData Not Working On Android

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.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,910)