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 / Patch – Update multipl...
Power Apps
Answered

Patch – Update multiple records using Filter Function

(0) ShareShare
ReportReport
Posted on by 78

Hi,

 

I am trying to update all values within a column, when the reference = “123.

 

I think I have to use filter and Patch, however the patch function asks me for which record. As I want all the records updated that have reference “123” I am not sure what to include.

 

I have used the lookup function, but this only updates one record with a “123” reference, but I need them all.

 

Please can someone tell me what to include for the record section. I have put my code below – but need to replace the “[All Records within filter]” part of the code.

 

 

ClearCollect(colTest,tDisposal);

ForAll( colTest,

Filter( tDisposal, Property_Reference = "123"),

    Patch( tDisposal, [All Records within filter],

                { Claimant_Company: "Company" }

    )

)

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Apologies for my last reply. I understand it wrongly, pls try this formula:

     

    ClearCollect(colTest,tDisposal);
    UpdateIf(colTest,Property_Reference = "123",{Claimant_Company: "Company"});
    Patch(tDisposal,colTest);

     

    Thanks

  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    Try this:

    ClearCollect(
    	colTest,
    	ShowColumns(
    		Filter(tDisposal, Property_Reference = "123"),
    		"ID","Claimant_Company"
    	)
    );
    
    UpdateIf(colTest, true, { Claimant_Company: "Company" });
    
    Patch(tDisposal,colTest);

    This code will create a collection with only ID and Claimant_Company

    it will update the column Claimant_Company of that collection

    and then Patch that collection to the database

     

    Any doubts let me know

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi

    You're almost there. 

    Do this:

    ClearCollect(colTest,tDisposal);
    ForAll(
    	Filter(
    		colTest,
    		Property_Reference="123" //(or 123 if its a number)
    	) As _patchRecords,
    	Patch(
    		tDisposal,
    		{ID:_patchRecords.ID},
    		{
    			Claimant_Company:"Company"
    
    		}
    	)
    )

     

    If you have a lot of records, you could add a Collect(Progress in the for all to make a progress bar).

     

    Hope this helps 🙂

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard