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 / ForAll Patch not Patch...
Power Apps
Suggested Answer

ForAll Patch not Patching Data

(0) ShareShare
ReportReport
Posted on by 762
Hello Community,
I need your help please, I have tried to find the answer but I'm struggling with this one.

I have a Gallery that shows multiple items, as I'm trying to build an Requisitions Application. and I have a GL Code Which is a Combo box, I've added a label for testing to show the values, but when I try to patch the data, it does not update each item I selected and also it updates another item in the SharePoint list that was not selected, as was already had the Approval Status as Approved for testing purpose.


This is the Button OnSelect property - I know I have the delegation warning, but just can't get this to work as expected.
I have tried to change the GLChoice Field to ddGLChoice.Selected.Value, I've tried using a Label in the patch with Text.



Running out of Idea's so really hoping someone can help me.
Thank you!
Claire


 
Categories:
I have the same question (0)
  • Artur Stepniak Profile Picture
    1,539 Moderator on at
    Hello,
     
    are you sure that the filtered collection contains the values that you'd like to update? I'd suggest you should check first after filtering if the variable is correctly updated.
     
    Let me know how it goes.
     
    Best regards,
     
    Artur Stepniak
  • timl Profile Picture
    36,634 Super User 2026 Season 1 on at
    Hi Claire,
     
    I notice that in step 2 of your screenshot, '= (ThisRecord.OrderID)' is underlined in red.
     
    This is the most likely cause of this issue. If you resolve the error that's given when you hover the mouse over that line, that will hopefully solve the problem. 
  • Pacel1 Profile Picture
    79 on at
    I assume you want to update all elements for which you select a value in the GLcode field?
    If so, the logic should look like this:
     
    ClearCollect(
        colilteredItems, 
        ForAll(
            Filter(
                Gallery1.AllItems,
                !IsBlank(ddGLChoice.Selected.Value)
            ),
            { OrderID: ThisRecord.ID, 			// Here You have to put field with ID number from Your source
    		  GlChoice: ThisRecord.ddGLChoice.Selected.Value	
    		}
        )
    )
    
    
    
    ForAll(
    	colFilteredItems, 
    	Patch(
    		CCOrderItems,
    		LookUp(CCOrderItems, OrderID = ThisRecord.OrderID),
    		{
    		GLChoice: ThisRecord.GlChoice
    		}
    )
    )
    
    
     
  • ClaireAllen Profile Picture
    762 on at
    timl, the error with the line is just a delegation warning, but thank you for the info.

    @Artur Stepniak, I'm not sure that the collection is working correctly as the GL Code always looks empty to me, but I will certainly double check that - thank you!

    @Pacel1, thank you for the information, I will take a look at what you have suggested.

     
  • WarrenBelz Profile Picture
    153,781 Most Valuable Professional on at
    Try using the As identifier - also possibly some overkill here, but it should work.
    With(
       {
          _Items:
          AddColumns(
             Filter(
                CCOrderItems,
                OrderID = Text(ddRequisitionID.Selected.ID) 
             ),
             OrderTxt,
             Text(OrderID)
          )
       },   
       ForAll(
          _Items As _I,
          Patch(
             CCOrderItems,
             LookUp(
                CCOrderItems, 
                OrderID = _I.OrderTxt
             ),
             {
                GLChoice: {Value: _I.ddGLChoice.Selected.Value}
             }
          )
       )
    );
     
    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   
    Buy me a coffee
  • 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   
  • Suggested answer
    ClaireAllen Profile Picture
    762 on at
    Thank you Community for your help and responses, I have managed to find a solution that works with Power Automate and Power Apps

    This is how I managed to get it working.
     
    ClearCollect(
        colFilteredItems,
        ForAll(
            Filter(
                GallCCOrderItems.AllItems,
                !IsBlank(ddGLChoice.Selected.Value)
            ),
            {
                OrderID: Text(ThisRecord.OrderID), // Ensure OrderID is treated as text
                GLChoice: ThisRecord.ddGLChoice.Selected, // Store the selected GLChoice
                RowID: ThisRecord.ID // Store the selected GLChoice
            }
        )
    );
    
    // Step 2: Trigger the flow to update SharePoint list
    ForAll(
        colFilteredItems As item,
        Notify("Patching OrderID: " & Text(item.OrderID) & " with GLChoice: " & item.GLChoice.Value, NotificationType.Information);
        
        'HM-PRCCUpdateGLChoiceAndApproval'.Run(
            Text(item.GLChoice.Value), // Pass the selected GLChoice value
            Text(item.OrderID), // Pass the selected OrderID
            Text(item.RowID) // Pass the selected OrderID
        )
    );
     
     

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
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard