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 / How to patch all items...
Power Apps
Answered

How to patch all items in source table based on condition

(0) ShareShare
ReportReport
Posted on by 31

Hello there,

I'm not quite sure if the subject of this topic can be interpreted correctly, but I will try to explain my scenario:

 

I have a gallery (galMain) displaying distinct user IDs from a SharePoint list (AppAllUsers). I've added a button to every gallery record, and now I want to achieve the following. When I click the button, it will read the user ID of the selected item (ThisItem) and patch every row in AppAllUsers where userID = ThisItem.userID. It should write a text string "Action01" to the column ActionID within the same SharePoint list.

 

I've tried to achieve this with a combination of ForAll, LookUp, and Patch functions, but I haven't succeeded. I can provide you with my formula, but I'm not sure if my approach is correct in the first place.

 

Many thanks for your suggestions and help.

Categories:
  • vkondreddygari Profile Picture
    88 on at

    You can try something like this-

     

    Patch( AppAllUsers, LookUp( AppAllUsers, userID = ThisItem.userID; ), { ActionID :"Action01"; } )

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    HI @janklaska,

    Please set the OnSelect property of the button as:

    UpdateIf(AppAllUsers,userID =Gallery7.Selected.userID ,{ActionID: "Action01" })
    
  • JK-20111451-0 Profile Picture
    31 on at

    Hello both,

    thank you very much for your suggestions. Both formulas work fine for me, but I selected @v-qiaqi-msft's reply as a solution to my problem, because I'm receiving a non-delegable warning with @vkondreddygari's LookUp formula. 🙂

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard