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 Based on a Gallery with the Same Data

(0) ShareShare
ReportReport
Posted on by 5

Dear all,

 

I would like to change the status of several items in SharePoint list from "Submitted" to "Approved" or "Rejected". To do so, I have a filtered Gallery called Gallery7 connected to the SharePoint list as follows:

 

Filter(MasterTS, Email = varRecord, Status ="Submitted")

 

Where:

 

MasterTS: SharePoint list with all the records

varRecord: Email of the person that submitted the data

Status: The column in the MasterTS that I would like to update

 

What formula could I use to update the status of all the items in this Gallery in my SharePoint list? I tried to use ForAll+Patch but I did not manage to make it work. The idea is that when the manager of the person that submitted the data clicks on the "Approved" button, this updates all the records submitted by this person.

 

Thanks in advance for your help.

 

 

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @sebastiangz7 

    You can do this with a ForAll as you mentioned.

    Your formula would be the following:

    ForAll(
     RenameColumns(Gallery7.AllItems, "ID", "_id"),
     UpdateIf(MsterTS, ID=_id,
     {Status: "Approved}
     )
    )

     

    I hope this is helpful for you.

  • mdevaney Profile Picture
    29,991 Moderator on at

    @sebastiangz7 
    The PATCH formula can be used without FORALL to perform bulk updates to SharePoint.  My proposal is to create a table of updates using only the gallery's ID & Status columns and then upsert them.  Doing this requires only 2 arguments to PATCH: target table and updates table.

    Put this code in the OnSelect property of the "Approve" button:

    Patch(
     your_sharepoint_list,
     UpdateIf(
     ShowColumns(
     Gallery1.AllItems,
     "ID",
     "Status"
     ),
     true,
     {Status: {Value: "Approved"}}
     )
    )


    Then put this code in the OnSelect property of the "Reject" button.

    Patch(
     your_sharepoint_list,
     UpdateIf(
     ShowColumns(
     Gallery1.AllItems,
     "ID",
     "Status"
     ),
     true,
     {Status: {Value: "Rejected"}}
     )
    )



    Note:  I assumed your Status column was a Choices type in SharePoint.  If its single-line text you will need to modify my formulas


    If you want to learn more about Bulk Modifying SharePoint Records you can check out this link: 

    Article - 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."

  • sebastiangz7 Profile Picture
    5 on at

    Thanks a lot! I had not used the UpdateIf function before, you saved my day! I spent hours on this 🙂

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard