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 / Patching Multiple Item...
Power Apps
Answered

Patching Multiple Items in a Gallery

(0) ShareShare
ReportReport
Posted on by 26

Hi,

I have a gallery with about 10 records stored. I am trying to figure out on how to patch multiple records in a gallery at the same time using a click of a button.

 

Inside my gallery, I want to use a checkbox. When I click on the checkbox for (let's say) 3 items out of the 10, I want to be able to update/patch those three records by pushing the "Submit" button. 

 

Please help.

 

Here is my code.

 

Patch(
    'CNRFC N7 Voting System',
    Gallery5.Selected,
    {BoardMember1: {Value: "00"}, BoardMember2: {Value: "00"}, BoardMember3: {Value: "00"}, BoardMember4: {Value: "00"}, BoardMember5: {Value: "00"}, BoardMember6: {Value: "00"}, BoardMember7: {Value: "00"}}
);
Categories:
  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @tlchounramany - I do not know what the data type is for the Board Member fields, but see the example pattern below (assumes SharePoint is your data source).

     

    Patch (
     'CNRFC N7 Voting System',
     ForAll(
     Filter(
     Gallery5.AllItems,
     Checkbox1.Value
     ),
     {
     ID: ID,
     //unique identifer column
     BoardMember1: "00",
    	 BoardMember2: "00"
     }
     )
    

     

     

  • tlchounramany Profile Picture
    26 on at

    Hi,

     

    Thank you for the response. All the BoardMember's field are choice type. Will I need to do anything different to the code that you have mentioned previously?

     

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @tlchounramany for a Choice field use the syntax you were previously using. E.g. {Value: "00"}

  • tlchounramany Profile Picture
    26 on at

    Thank you. It cleared the error, but nothing is happening when I clicked on the "Submit" button. I've pasted the below code to the "OnSelect" section of the button. 

     

    Patch (
         'CNRFC N7 Voting System',
        ForAll(
            Filter(
                Gallery5.AllItems,
                Checkbox1.Value
            ),
            {
                ID: ID,
                //unique identifer column
                BoardMember1: {Value: "00"}, BoardMember2: {Value: "00"}
            }
        )
    )
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @tlchounramany - I am assuming you clicked at least one Checkbox prior to selecting the Button?

     

    Could you send a screenshot of the tree view of your Gallery.

  • tlchounramany Profile Picture
    26 on at

    You know what!? As I was going to screenshot the tree view of the gallery, I didn't realize that inside the Patch function, I had Checkbox1.Value. It should have been Checkbox3.Value.

     

    I believe everything works as intended. Thank you so much for your help.

    Capture1.JPG
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @tlchounramany - please remember to accept the solution.

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

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard