cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
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

Highlighted
Super User III
Super User III

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
Highlighted
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

Highlighted
Dual Super User III
Dual Super User III

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.
Highlighted
Super User III
Super User III

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
Helper I
Helper I

Re: patch the multiple items where condition satisfies

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,879)