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 Apps
Unanswered

Patch with forall

(0) ShareShare
ReportReport
Posted on by 220

I am having trouble with a forall and patch formula. Below is my code.

ForAll(Gallery1_1.AllItems,
Patch('Information Barriers Instruction Users',
'Instruction Id'= Label2.Text,
{'Status (eusw_status)' : 'Information Barrier Status'.Approved}))


Gallery items : Filter( 'Information Barriers Instruction Users', 'Instruction Id' = Label3.Text)
asssss.PNG
I am using a forall to loop through the items and update the status column ( an option set)  from draft to approved. I am assuming the problem is with the ID column( instruction id ). My datasource is CDS linked with F&O via dual write.  The table in F&O has an indexing where unique key is a combination of email and 'instruction id'.  Can someone please help me how to deal with this problem.?

Categories:
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @P_SA ,

    The correct syntax is as below, but what is Label2.Text - the value needs to be in the Gallery to identify the records that need to be Patched.

    ForAll(
     Gallery1_1.AllItems,
     Patch(
     'Information Barriers Instruction Users',
     {'Instruction Id':Label2.Text),
     {'Status (eusw_status)' : 'Information Barrier Status'.Approved}
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

     

  • P_SA Profile Picture
    220 on at

    Hi @WarrenBelz  ,  label2.text is the instruction id to identify the records.  I am not able to identify the records based on the instruction ID.  As i said earlier, the unique key is a combination of instruction id and email.. 

    so when I try to patch with forall, i am struggling to identify the records based on the unique key. 

     

    error.PNG

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @P_SA ,

    So is Label2 the email box shown in your post and what is it combined with to form the unique key? If for instance it was a number (I will call it ID) that is in the gallery data, you would do something like this

    ForAll(
     Gallery1_1.AllItems,
     Patch(
     'Information Barriers Instruction Users',
     {'Instruction Id':ID&Label2.Text),
     {'Status (eusw_status)' : 'Information Barrier Status'.Approved}
     )
    )

    can you please explain exactly how you arrive at the unique key.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @P_SA ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard