web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / App in offline mode, n...
Power Apps
Unanswered

App in offline mode, not save data in sharepoint list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I follow a tutorial about app in offline mode, and looks fine.

Tutorial: https://matthewdevaney.com/power-apps-offline-mode-a-step-by-step-tutorial/

This is the code.

App property OnStart:

 

 

// get the current user's email
Set(
 varUserEmail,
 User().Email
 );

 

 

Form Screen

Button Submit Form

 

 

/ update collection with form data
 Patch(
 colHomeInspections,
 LookUp(colHomeInspections, ID=varCurrentRecord.ID),
 form_Form_Main.Updates
 
 );
 // save collection to local device
 SaveData(
 colHomeInspections,
 "localHomeInspections"
 );
 /* more code added below */

 // track record that was edited
 Collect(
 colUnsavedRecords,
 {ID: varCurrentRecord.ID}
 );
 // save collection to local device
 SaveData(
 colUnsavedRecords,
 "localUnsavedRecords"
 );
 Navigate('Saving Screen');

 

 

Admin Screen

tog_DebugMode

 

 

Default : True

 

 

 

Saving screen

OnVisible

 

 

If(!tog_DebugMode.Value, Select(btn_Saving_Actions))

 

 

Button Saving

 

 

// Check if device is online
If(Connection.Connected,

 // Add or update records in SharePoint
 Patch(
 'Home Inspections',
 // Choose which columns are written to SharePoint 
 ShowColumns(
 // Only write records with ID found in colUnsavedRecords
 Filter(
 colHomeInspections,
 ID in colUnsavedRecords.ID
 ),
 "ID",
 "Adress",
 "StartTime",
 "AsignedTo",
 "Report"
 )
 );

 // Clear unsaved records collection
 Clear(colUnsavedRecords);
 SaveData(
 colUnsavedRecords,
 "localUnsavedRecords"
 );
);

UpdateContext({locMessage: "Saving completed"});
Navigate('Loading Screen');

 

 

Loading Screen

OnVisible

 

 

If(!tog_DebugMode.Value, Select(btn_Loading_Actions))

 

 

and my sharepoint list have the next fields:

  • ID
  • AsignedTo
  • StartTime
  • Adress
  • Report
  • Pic
  • Ide

 

I see the app just works in offline mode, if I have internet appears an errors.

But the problem is, the app not save data in sharepoint list, for example, if I update a record, the information, than I changed is not saved in the list.

I attatch some pictures to explain better

Regards.

Sharepoint list..PNG
app.png
Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

    could you please check it? 😕

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Anonymous ,

    Please have another look at this code

    Patch(
     'Home Inspections',
     // Choose which columns are written to SharePoint 
     ShowColumns(
     // Only write records with ID found in colUnsavedRecords
     Filter(
     colHomeInspections,
     ID in colUnsavedRecords.ID
     ),
     "ID",
     "Adress",
     "StartTime",
     "AsignedTo",
     "Report"
     )
    );

    and tell me what you had in mind when you wrote it, particularly using ShowColmns in a Patch.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

    To check if the device is connected to the Internet and to rewrite unsaved records to SharePoint.

     

    It's wrong?

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Anonymous ,

    Yes - that is not the Patch syntax - please have a read of this document

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

    This part is from the tutorial in the Saving Screen section, and I check the internet and I think there is a similar syntax.

    I attach the pictures.

    tutorial: https://matthewdevaney.com/power-apps-offline-mode-a-step-by-step-tutorial/

    internet: https://www.c-sharpcorner.com/article/powerapps-patch-fuction-with-complex-columns/

     

    Can you please check the tutorial in the part Saving Screen

    tutorial patch syntax.PNG
    patch syntax.PNG
  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Anonymous ,

    What you have (now you have mentioned where you got it) seems to be trying to line up (in an unusual way) the Items you are wanting to Patch with the List fields required and then hoping Patch takes care of it. I have never found this to reliably work in all cases, so do not use it.

    For me to help you, please have a go at Patching normally stipulating the fields and the values to be written to them.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

    Can you teach me how can I do that? 

    To be honest I don't know 😞

     

    Regards

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    @Anonymous ,

    Please read the document I linked earlier.

    I am happy to help you with correcting code, but cannot write it for you.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,

    I had a read to the document: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch.

    So, I modify the code like this:

    // Check if device is online
    If(Connection.Connected,
    
     // Add or update records in SharePoint
     Patch(
     'Home Inspections',
     colHomeInspections,
     { 
     Codi: DataCardValue2.Text,
     AsignedTo: DataCardValue8.Text,
     StartTime: DataCardValue7.SelectedDate,
     Adress: DataCardValue10.Text,
     Report: DataCardValue9.Text
     }); 
     
    
     // Clear unsaved records collection
     Clear(colUnsavedRecords);
     SaveData(
     colUnsavedRecords,
     "localUnsavedRecords"
     );
    );
    
    UpdateContext({locMessage: "Saving completed"});
    Navigate('Loading Screen');

    I modify like I got it, but show the error: The function Patch have some invalid arguments.

     

    Regards.

     

     

    Sharepoint list2.PNG
  • powercorner Profile Picture
    477 on at

    Hello @Anonymous ,

    please double check if the SharePoint column types are the same as the data you are sending within the patch function!

     Codi: DataCardValue2.Text, (is Codi a text column?)
     AsignedTo: DataCardValue8.Text, (is AsignedTo a text column?)
     StartTime: DataCardValue7.SelectedDate, (is StartTime a time column?)
     Adress: DataCardValue10.Text, (is Adress a text column?)
     Report: DataCardValue9.Text (is Report a text column?)


    WIth regards

    Kevin

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard