cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

Re: Patch with forall

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.

 

 

 

Highlighted
Helper IV
Helper IV

Re: Patch with forall

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

Highlighted
Super User III
Super User III

Re: Patch with forall

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

Highlighted
Super User III
Super User III

Re: Patch with forall

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,472)