PowerApps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
Expand all | Collapse all

Offline Edit then Update

  • 1.  Offline Edit then Update

    Posted Jul 16, 2019 08:10 AM
    Hi All,

    I am creating an app that needs to work offline during a persons shift. Its for testing assets in a register.

    Current workflow is:
    1. User starts a shift (when an internet connection is available)
    2. Data from a sharepoint list is saved to a local collection
    3. The user can then view the details of assets in the collection, or complete a test on the asset and record the results
    4. At the end of a shift (again when a connection is available), I want to update the sharepoint register with any test details that have been updated while offline
    A couple of issues:
     - If the list doesn't have a date in the 'DateLastTested' column, it won't get updated when I hit save. Code I'm using is:
         "Patch(AssetDB, AssetGallery.Selected, { DateLastTested: Now(), ChangedRecently: true});
    Navigate(AssetBrowse)"
     - I've also tried setting a "Changed Recently" flag, but again it doesn't work unless I've put a 'yes' or 'no' into that column. If its blank it doesn't get switched.

    I haven't been able to get the local collection (AssetDB) to update to Sharepoint either. Ideally I'd like to check that the 'DateLastTested' field in the local collection (AssetDB) is after the date on the Sharepoint list, that way I'm only patching in updated records in.

    Any help would be greatly appreciated.

    Thanks

    Adam





    ------------------------------
    Adam Gibbs

    ------------------------------


  • 2.  RE: Offline Edit then Update

    Silver Contributor
    Posted Jul 16, 2019 01:38 PM
    I would suggest moving the Navigate command to the OnSuccess of the form - at least for testing. You could add a command to the OnChange of your various fields that would set the "Changed Recently" flag to true.
    On your last point you should be able to use a ForAll function in an If and just test for the current date

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



  • 3.  RE: Offline Edit then Update

    Posted Jul 16, 2019 07:10 PM
    Thanks Brian,

    I managed to get the record update and 'çhanged recently' flag working - I needed to change from using Patch to UpdateIf.

    I'll have another go at ForAll for the final database update, I'm just struggling with the syntax needed.

    Adam

    ------------------------------
    Adam Gibbs
    6053
    439468299
    ------------------------------