cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vshah804
Level: Powered On

patch the multiple items where condition satisfies

Hello Team, I'm trying to patch the multiple items where condition satisfies but with below formula, It is patching only first item.

 

Patch('[dbo].[Table]',ColumnName1="Text"),{ColumnName2:"YES"})

 

i want to patch all items in ColumnName2 with "YES" where It finds ColumnName1="Text" in dbo].[Table]

 

Please help.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: patch the multiple items where condition satisfies

For updating multiple records that match a condition, use the UpdateIf function rather tha Patch. Patch is for adding or updating a single record.

To *add* multiple records you can use Collect.

View solution in original post

Super User
Super User

Re: patch the multiple items where condition satisfies

@vshah804 

Consider using the UpdateIf function for this operation. 

UpdateIf will update records based on a criteria.

 

Your formula would be as follows:

UpdateIf('[dbo].[Table]', ColumnName1="Text", {ColumnName2: "YES"})

I hope that is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: patch the multiple items where condition satisfies

For updating multiple records that match a condition, use the UpdateIf function rather tha Patch. Patch is for adding or updating a single record.

To *add* multiple records you can use Collect.

View solution in original post

Dual Super User
Dual Super User

Re: patch the multiple items where condition satisfies

Take a look at the following article.  It shows how to patch multiple records in a Batch using Patch and ForAll.

https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch/



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Super User
Super User

Re: patch the multiple items where condition satisfies

@vshah804 

Consider using the UpdateIf function for this operation. 

UpdateIf will update records based on a criteria.

 

Your formula would be as follows:

UpdateIf('[dbo].[Table]', ColumnName1="Text", {ColumnName2: "YES"})

I hope that is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

vshah804
Level: Powered On

Re: patch the multiple items where condition satisfies

Thanks a lot. It works like a charm!:)

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,503)