cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

Patch with forall

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.?

4 REPLIES 4
Super User III
Super User III

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.

 

 

 

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

@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.

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.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (80,194)