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 / Pat;ch with Multiple F...
Power Apps
Suggested Answer

Pat;ch with Multiple ForAll

(1) ShareShare
ReportReport
Posted on by 44
I have a Power Apps screen with a series on TextInputs and two galleries.

I am tryin to Patch the data to a SharePoint list.

I was able to do it with the Patch and one ForAll succuessfully. But once I added the second
ForAll I get an error.

What am I missing?

There error says "Title isn't recognized". When I delete Title the error moves to the next item (Job_Name).
Patch(Work_Order_List,
    ForAll(WO_Component_Gallery.AllItems,
    {
     Component: Dropdown1.Selected.Value,
     Component_Description: TextInput3.Text,
     Component_Notes: TextInput3_1.Text,
     Component_Quantity: Value(TextInput3_3.Text),
     Component_UoM: TextInput3_4.Text,
     Component_Unit_Price: Value(TextInput3_5.Text),
     Component_Extension: Value(TextInput3_6.Text)
    },
 
    ForAll(WO_Labor_and_Equipment_Gallery.AllItems,
    {
     Labor_and_Equipment: Dropdown1_1.Selected.Value,
     L_and_E_Description: TextInput3_7.Text,
     L_and_E_Notes: TextInput3_8.Text,
     L_And_E_Quantity: Value(TextInput3_10.Text),
     L_and_E_UoM: TextInput3_11.Text,
     L_and_E_Unit_Price: Value(TextInput3_12.Text),
     L_and_E_Extension: Value(TextInput3_13.Text),
    },
       
     Title: WO_Customer_CO_No_Fld.Text,
     Job_Name: WO_Job_Name_Fld.Text,
     Job_Number: WO_Job_Number_Fld.Text,
     Date_of_Service: WO_Date_of_Service_Fld.SelectedDate,
     Customer_Name: WO_Customer_1_Fld.Text,
     Point_of_Contact: WO_Point_of_Contract_Fld.Text,
     Phone: WO_Contact_Phone_Fld.Text,
     Email_Address: WO_Contact_Email_Fld.Text,
     Scope_of_Work: WO_Scope_of_Work_Fld.Text
    }
   
);
 
Notify("The work order data has been successfully submitted.",NotificationType.Success,5000)
Categories:
I have the same question (0)
  • Suggested answer
    mmbr1606 Profile Picture
    14,605 Super User 2026 Season 1 on at
    hey
     
    can u try this:
    ForAll(
        WO_Component_Gallery.AllItems,
        Patch(
            Work_Order_List,
            Defaults(Work_Order_List),
            {
                Component: Dropdown1.Selected.Value,
                Component_Description: TextInput3.Text,
                Component_Notes: TextInput3_1.Text,
                Component_Quantity: Value(TextInput3_3.Text),
                Component_UoM: TextInput3_4.Text,
                Component_Unit_Price: Value(TextInput3_5.Text),
                Component_Extension: Value(TextInput3_6.Text),
                Title: WO_Customer_CO_No_Fld.Text,
                Job_Name: WO_Job_Name_Fld.Text,
                Job_Number: WO_Job_Number_Fld.Text,
                Date_of_Service: WO_Date_of_Service_Fld.SelectedDate,
                Customer_Name: WO_Customer_1_Fld.Text,
                Point_of_Contact: WO_Point_of_Contract_Fld.Text,
                Phone: WO_Contact_Phone_Fld.Text,
                Email_Address: WO_Contact_Email_Fld.Text,
                Scope_of_Work: WO_Scope_of_Work_Fld.Text
            }
        )
    );
    
    ForAll(
        WO_Labor_and_Equipment_Gallery.AllItems,
        Patch(
            Work_Order_List,
            Defaults(Work_Order_List),
            {
                Labor_and_Equipment: Dropdown1_1.Selected.Value,
                L_and_E_Description: TextInput3_7.Text,
                L_and_E_Notes: TextInput3_8.Text,
                L_And_E_Quantity: Value(TextInput3_10.Text),
                L_and_E_UoM: TextInput3_11.Text,
                L_and_E_Unit_Price: Value(TextInput3_12.Text),
                L_and_E_Extension: Value(TextInput3_13.Text),
                Title: WO_Customer_CO_No_Fld.Text,
                Job_Name: WO_Job_Name_Fld.Text,
                Job_Number: WO_Job_Number_Fld.Text,
                Date_of_Service: WO_Date_of_Service_Fld.SelectedDate,
                Customer_Name: WO_Customer_1_Fld.Text,
                Point_of_Contact: WO_Point_of_Contract_Fld.Text,
                Phone: WO_Contact_Phone_Fld.Text,
                Email_Address: WO_Contact_Email_Fld.Text,
                Scope_of_Work: WO_Scope_of_Work_Fld.Text
            }
        )
    );
    
    Notify("The work order data has been successfully submitted.", NotificationType.Success, 5000);
    
    if it worked please mark as verified answer
     
     
    cheers
  • BD-01080338-0 Profile Picture
    44 on at
    Thanks for your reply.
     
    That did NOT work either.
  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at
    Coming in here to point out the fundamental issue - if (as I assume) you are trying patch all of that to one new record combining the two galleries and also the control values outside the gallery, you need to "line up" it all into records before you Patch. Assuming both galleries have the same number of records - it would be something like this (please note this is free-typed, so more to give you an idea of what has to be done). You need to
    • Grab the two galleries applying the correct field names (from the List).
    • Add a sequential identifying number so you can "line up" the records.
    • Combine the whole lot into one Table adding all the values from both galleries and also the "common" values.
    • Patch the resulting Table directly to the List. Providing all the field names exist in the List and are of the same type, it should work.
    With(
       {
          _Component:
          ForAll(
             WO_Component_Gallery.AllItems As _WOC,
             {
                Component: _WOC.Dropdown1.Selected.Value,
                Component_Description: _WOC.TextInput3.Text,
                Component_Notes: _WOC.TextInput3_1.Text,
                Component_Quantity: Value(_WOC.TextInput3_3.Text),
                Component_UoM: _WOC.TextInput3_4.Text,
                Component_Unit_Price: Value(_WOC.TextInput3_5.Text),
                Component_Extension: Value(_WOC.TextInput3_6.Text)
             }
          ),
          _Labor:
          ForAll(
             WO_Labor_and_Equipment_Gallery.AllItems As _WOL,
             {
                Labor_and_Equipment: _WOL.Dropdown1_1.Selected.Value,
                L_and_E_Description: _WOL.TextInput3_7.Text,
                L_and_E_Notes: _WOL.TextInput3_8.Text,
                L_And_E_Quantity: Value(_WOL.TextInput3_10.Text),
                L_and_E_UoM: _WOL.TextInput3_11.Text,
                L_and_E_Unit_Price: Value(_WOL.TextInput3_12.Text),
                L_and_E_Extension: Value(_WOL.TextInput3_13.Text),
             }
          )
       },
       With(
          {   
             _CompNo:
             ForAll(
                Sequence(CountRows(_Component)),
                Patch(
                   Index(
                      _Component,
                      Value
                   ),
                   {No1: Value}
                )
             ),
             _LaborNo:
             ForAll(
                Sequence(CountRows(_Labor)),
                Patch(
                   Index(
                      _Labor,
                      Value
                   ),
                   {No2: Value}
                )
             )
          },
          With(
             {
                _Combined:
                DropColumns(
                   AddColumns(
                      CompNo,
                      Labor_and_Equipment,
                      LookUp(
                         _LaborNo,
                         No2 = No1
                      ).Labor_and_Equipment,
                      L_and_E_Description,
                      LookUp(
                         _LaborNo,
                         No2 = No1
                      ).L_and_E_Description,
                      L_and_E_Notes,
                      LookUp(
                         _LaborNo,
                         No2 = No1
                      ).L_and_E_Notes,
                      L_And_E_Quantity,
                      LookUp(
                         _LaborNo,
                         No2 = No1
                      ).L_And_E_Quantity,
                      L_and_E_UoM,
                      LookUp(
                         _LaborNo,
                         No2 = No1
                      ).L_and_E_UoM,
                      L_and_E_Unit_Price,
                      LookUp(
                         _LaborNo,
                         No2 = No1
                      ).L_and_E_Unit_Price,
                      L_and_E_Extension,
                      LookUp(
                         _LaborNo,
                         No2 = No1
                      ).L_and_E_Extension,
                      Title,
                      WO_Customer_CO_No_Fld.Text,
                      Job_Name, 
                      WO_Job_Name_Fld.Text,
                      Job_Number, 
                      WO_Job_Number_Fld.Text,
                      Date_of_Service, 
                      WO_Date_of_Service_Fld.SelectedDate,
                      Customer_Name,
                      WO_Customer_1_Fld.Text,
                      Point_of_Contact,
                      WO_Point_of_Contract_Fld.Text,
                      Phone, 
                      WO_Contact_Phone_Fld.Text,
                      Email_Address, 
                      WO_Contact_Email_Fld.Text,
                      Scope_of_Work, 
                      WO_Scope_of_Work_Fld.Text
                   ),
                   No1
                )
             },
             Patch(
                Work_Order_List,
                _Combined
             )
          )
       )
    )

     
  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for or if you need further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 93 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard