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 same column in ...
Power Apps
Answered

Update same column in multiple SharePoint items based on another column

(0) ShareShare
ReportReport
Posted on by 282

I have a list called "CapEx_Roles" that is used to manage users assigned to roles for use in my PowerApp. It has four columns - "Review Index", "Review Phase", "Role" (Renamed Title field) and "Name" (Person Field)...

rkirk2k_0-1692378601873.png

Notice that for three of the items, the role is "Operations Manager" - so I need to patch the "Name" column for all three whenever the "Role" column equals "Operations Manager".

 

I built a form to allow Admins to update the "Name" column for the roles in this list.

rkirk2k_2-1692379016942.png

 

I'm attempting to use the following function to execute the "Patch" to all items where "Role" equals "Operations Manager" - and it is giving the error "Invalid number of arguments: received 1, expected 2."

rkirk2k_1-1692378830555.png

Any help in identifying the problem with my formula is greatly appreciated!

Categories:
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @rkirk2k,

     

    You can loop through a Filter statement and update the looped records. Please try the following code:

     

    //Option 1, delegable
    With(
     {
     wRecords: Filter(
     CapEx_Roles,
     Title = "Operations Manager"
     )
     },
     ForAll(
     wRecords,
     Patch(
     CapEx_Roles,
     ThisRecord,
     {Name: YOUR_NAME_CODE_HERE}
     )
     )
    )

     

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

    Thanks!

  • rkirk2k Profile Picture
    282 on at

    I feel like that got me closer, but I'm getting a different error now on the Patch function...

    rkirk2k_0-1692381126386.png

    Thoughts?

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @rkirk2k,

     

    Indeed, my apologies for the mistake. I have adjusted my initial comment's code, could you try again?

  • rkirk2k Profile Picture
    282 on at

    Worked perfectly! Thank you so much.

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 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard