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.
Solved! Go to Solution.
I got this to work by using the following code instead:
ForAll(MaintUpdateList,Patch('[dbo].[PYR_MAINTREVIEW]',{MNT_ID: MNT_ID},{STAT:"REVIEWED"})));
I got this to work by using the following code instead:
ForAll(MaintUpdateList,Patch('[dbo].[PYR_MAINTREVIEW]',{MNT_ID: MNT_ID},{STAT:"REVIEWED"})));
User | Count |
---|---|
254 | |
112 | |
92 | |
48 | |
38 |