Power Apps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
 View Only
  • 1.  Offline Function "SaveData" Error in PowerApps Studio

    Posted Jul 22, 2021 05:32 AM
    Edited by Fabian Heil Jul 22, 2021 05:40 AM
    I´m currently build a PowerApps with partly offline functionality. According to Shane Youngs Youtube Video, i´m using "SaveData" everytime i patch into a collection.
    As "SaveData" is not working in the Browser, it always shows an error when running it in the studio.
    Is there a way to only run it, when its used in a mobile device? Otherwise its very confusing during development to always have these errors

    And second question:
    Is there a function to check, if there is currently saved data in the cache. Background: i want to show a hint, that there is unsaved data and a button to load this data.



    ------------------------------
    Fabian Heil
    ------------------------------


  • 2.  RE: Offline Function "SaveData" Error in PowerApps Studio
    Best Answer

    Top Contributor
    Posted Jul 23, 2021 01:33 AM
    Hi @Fabian Heil,
    You cannot test LoadData/SaveData in a browser - it will only run on mobile devices.​
    I also run a test at App OnStart
    If(
       Location.Altitude > 0 ||
       Acceleration.X > 0,
       LoadData . . . . 
    )​

    so users on PCs do not receive any errors These tests will only return true on a mobile device).
    Second question, all you can do is LoadData and then see if the Collection is empty (or not).



    ------------------------------
    Warren Belz
    Queensland Australia
    ------------------------------



  • 3.  RE: Offline Function "SaveData" Error in PowerApps Studio

    Posted Jul 23, 2021 10:33 AM
    Thank you very much!

    ------------------------------
    Fabian Heil
    ------------------------------



  • 4.  RE: Offline Function "SaveData" Error in PowerApps Studio

    Top Contributor
    Posted Jul 23, 2021 10:56 AM
    I thought that the Save / Load functionality worked in the PA desktop player which is available in the Microsoft Store. I do not have an app handy with that function to test it.

    ------------------------------
    Brian Scott
    Chief Creative Officer
    Concord NC
    ------------------------------



  • 5.  RE: Offline Function "SaveData" Error in PowerApps Studio

    Top Contributor
    Posted Jul 23, 2021 11:06 AM
    I just tested it and the desktop player does let you save and load data

    ------------------------------
    Brian Scott
    Chief Creative Officer
    Concord NC
    ------------------------------



  • 6.  RE: Offline Function "SaveData" Error in PowerApps Studio

    Top Contributor
    Posted Jul 23, 2021 07:48 PM
    Thanks Brian,
    I must admit I have never bothered testing that as the Desktop app has no real advantage for me over the browser-based running and I do not use it.
    The small problem however is that you still have to save the app (you cannot test it in run mode as that will just open in a browser) and then open in it in the app. I guess I am lucky to have an iPad on the desk and I just test it in that.

    ------------------------------
    Warren Belz
    Queensland Australia
    ------------------------------