cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

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