cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

ForAll with Patch not updating records

I found the following item in a post about bulk updating records - I am trying to update the status field in my database table from a list of ids in a collection.

 

To update the Status of CheckedItems to “Done”, when the source and destination table column names are the same, here is the formula

ForAll(CheckedItems,Patch(ChecklistItemsSource,LookUp(ChecklistItemsSource, Id = CheckedItems[@Id]),{Status:"Done"}))

 

My actual code is

 

ForAll(MaintUpdateList,

     Patch('[dbo].[PYR_MAINTREVIEW]',

             LookUp('[dbo].[PYR_MAINTREVIEW]', MNT_ID= MaintUpdateList[@MNT_ID]),{Status:"Done"}))

 

My MaintUpdate List collection holds the primary key of the records I need to Update in the PYR_MAINTREVIEW table but this code does nothing.  

 

I am getting a delegation warning but this only updates a hand-full or records max so I wouldn't think that would be a problem would it?  

 

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: ForAll with Patch not updating records

I got this to work by using the following code instead:

ForAll(MaintUpdateList,Patch('[dbo].[PYR_MAINTREVIEW]',{MNT_ID: MNT_ID},{STAT:"REVIEWED"})));

View solution in original post

1 REPLY 1
Highlighted
Anonymous
Not applicable

Re: ForAll with Patch not updating records

I got this to work by using the following code instead:

ForAll(MaintUpdateList,Patch('[dbo].[PYR_MAINTREVIEW]',{MNT_ID: MNT_ID},{STAT:"REVIEWED"})));

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (8,157)