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

Can we add multiple patch function in ForAll function of powerapps?

Below is the code for patching a new record in sharepoint list.

 

Patch(AOA_FT_Response,Defaults(AOA_FT_Response),
{field_Equipment_Name:Var_Eqp_Selected_Cond,
field_Check_List:Lbl_CheckPoint.Text,
Check_Sr_N:lbl_Sino.Text,
field_Response_Value:If(Radio4.Visible,Radio4.SelectedText.Value,Txt_Ip_Data.Text),
field_Actions_Taken:If(Chk_Box_Action_1.Value,"* " &Chk_Box_Action_1.Text)&If(Chk_Box_Action_2.Value," * "& Chk_Box_Action_2.Text)&If(Chk_Box_Action_3.Value," * " & Chk_Box_Action_3.Text)&If(Chk_Box_Action_4.Value," * " & Chk_Box_Action_4.Text)&If(Chk_Box_Action_5.Value," * " & Chk_Box_Action_5.Text)&If(Chk_Box_Action_6.Value," * " & Chk_Box_Action_6.Text),
field_Start_Time:Var_Start_Time,
field_End_Time:Now(),
User: TextInput3.Text
})
);

 

This sharepoint list AOA_FT_Response will hold all responses which user enter in the form.

Now our client has given one more requirement of creating new sharepoint list which will hold only abnormal conditions entered by user. Can I write same code as posted above using forall and patch in the save button for abnormal conditions?

Can we nest multiple patch function in powerapps?

 

Please help.

1 REPLY 1
BCLS776
Super User
Super User

You can use Patch() within a ForAll(), however make sure to use the As operator to clear up record scope. For example:

ForAll(myTable As aRecord,
    Patch(myTable2, Defaults(myTable2),
    {
        Value: aRecord.columnName
    }
    )
)

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,867)