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 / Update Multiple record...
Power Apps
Answered

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard