cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vshah804
Frequent Visitor

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

Highlighted
vshah804
Frequent Visitor

Re: patch the multiple items where condition satisfies

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

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,947)