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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update Multiple record...
Power Apps
Unanswered

Update Multiple records in SharePoint List from Gallery/collection

(0) ShareShare
ReportReport
Posted on by 18

Hi

 

I am trying to update multiple records in a SharePoint list based on what has been selected in a gallery.

 

Currently I have a gallery which will show all records from the SharePoint list, I can then select multiple of them using this guide: https://www.agarwalritika.com/post/select-multiple-items-in-a-power-apps-gallery-canvas-apps (if this is not the way to do this please let me know).

 

I then need to select a button and update all the selected records. 

 

I can get it to update one record (the last one selected) using this code:

Patch('Parcel List', Gallery3.Selected ,{'Picked Up': true ,'Date Picked Up':DateAdd(Now(),8,Hours),Signature:PenInput1.Image});

I have tried ForAll but I cannot get it to work:

ForAll(Gallery3.AllItems,Patch('Parcel List',LookUp('Parcel List', Gallery3.Selected.ID = 'Parcel List'.ID), {'Picked Up': true ,'Date Picked Up':DateAdd(Now(),8,Hours),Signature:PenInput1.Image}))

I have looked at other posts (example) but i have had no luck.

 

Can anyone help?

Thanks in advanced.

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @CGibson so according to the guide, you are saving all selected items to a collection.

    This is the collection that needs to be mentioned in the ForAll, the Gallery3.AllItems will loop over all items (not only the selected).

     

    If your gallery Item property is just the SP list (no grouping, or collection etc...) try the following code:

     

    ForAll(
     GallerySelectedCollection,
     Patch('Parcel List',
     ThisRecord, 
     {'Picked Up': true ,'Date Picked Up':DateAdd(Now(),8,Hours),Signature:PenInput1.Image}
     )
    )

     

     

    If your Items property of the gallery is not directly referencing the SP List try:

     

    ForAll(
     GallerySelectedCollection As Main,
     Patch('Parcel List',
     LookUp('Parcel List', ID = Main.ID), 
     {'Picked Up': true ,'Date Picked Up':DateAdd(Now(),8,Hours),Signature:PenInput1.Image}
     )
    )

     

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks! 

  • CGibson Profile Picture
    18 on at

    @LaurensM  This worked, thank you!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard