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 / patch data within a co...
Power Apps
Answered

patch data within a collection

(0) ShareShare
ReportReport
Posted on by 40

Hey Power Apps Community, 

 

I have a simple app that has 4 fields on it. Work order number, Customer Name, Disclaimer Text, and a signature control. 

 

The goal of this app is to collect a signature for service work that has been completed satisfactorily. 

 

When one of my field technicians is in a remote location without data I need to save the data in a collection. I have accomplished this by checking if connection.connected different buttons will display. If not connected button completes a collect and stores the data in a collection. If connected the button completes a submit. 

My question is how do I take ALL items in the collection and submit the data to Sharepoint list?

 

Thank you!

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @xbommer07 

    You can patch all items in a collection to a datasource like this:

     

    Patch(your_datasource_name, colYourCollection)

     


    If you would like to see an example of how it works I wrote an article on this subject.

     

    PATCH Multiple Records 10x Faster Article link:

    https://matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • xbommer07 Profile Picture
    40 on at

    @mdevaney 

     

    I am getting an error in the formula when placing this in OnStart. 

     

     

    Image 11.jpg
  • mdevaney Profile Picture
    29,993 Moderator on at

    @xbommer07 

    That’s odd, why are you using PATCH in the App OnStart property?

     

    Please share any details needed for me to recreate your issue.

  • xbommer07 Profile Picture
    40 on at

    @mdevaney 

     

    I will add on to my original post here. My thought is if one of my field technicians are outside of cellular data range then the data should be saved in a collection. Then the next time they open the app I want it to check if they have data and submit all items in the collection to sharepoint. 

     

    This may not be the best way to do it. I need the app to be able to save data offline and then submit when they are back in range to get data. My technicians sometimes have to go to remote locations to complete work. 

     

    If you have any better ideas I am all ears. I will try adding the patch to a button and see if that works in the mean time. I would however like to make it automated as my technicians are often times unreliable when it comes to procedural work. 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @xbommer07 

    I suggest you check out this article on how to accomplish online/offline scenarios.  It’s super in-depth and helpful.

     

    https://jobs.collab365.community/powerapps-offline-disconnected-mode/

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @xbommer07 ,

    Regarding the needs that you mentioned, I agree with your thought almost. You could consider put your formula within the OnStart property of the App. Of course, you could also consider add a Timer control in your canvas app to detect if the canvas app is online.

     

    If you want to patch your local collection back to your SP List, please try the following formula:

    If(
     Connection.Connected,
     ForAll(
     Local_Auth As LoopItem,
     Patch(
     'Delivery Receipts',
     Defaults('Delivery Receipts'),
     LoopItem
     )
     )
    )

    or

    If(
     Connection.Connected,
     Collect(
     'Delivery Receipts',
     Local_Auth
     )
    )

    Note: I assume that the Local_Auth has same data structure as your SP List.

    ForAll function, Patch function, Collect function

     

    If the Local_Auth does not have same data structure as your SP List, please try the following workaround:

    If(
     Connection.Connected,
     ForAll(
     Local_Auth As LoopItem,
     Patch(
     'Delivery Receipts',
     Defaults('Delivery Receipts'),
     {
     Column1: LoopItem.Column1,
     Column2: LoopItem.Column2,
     Column3: LoopItem.Column3,
     ...
     ...
     }
     )
     )
    )

     

    Please also check and see if the following blog would help in your scenario:

    https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

     

    Regards,

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard