As part of an app I am developing I need to be able to patch the contents of a collection to a sharepoint list. I want to avoid using a forall loop as the number of records will be quite large and that would be quite a slow procedure.
Basically I iterate through a list of items and depending on criteria it will add completed item to a collection that the user is able to look through and check, make changes etc. Once they have confirmed the data in the three different collections one of them is used to update each of the records within it (originate from Deductions list) to inactive.
This is how I'm building the collection:
ForAll(
Filter(Deductions, DeductionActive = 1 && RecurringDeduction = 0 && WorkerId = WorkerID) As Deduction,
//... Do some other stuff, generate values etc
If(
(Deduction.TotalDeduction - CompletedDeduction - DeductAmount) = 0,
Collect(FinishedDeductions, Deduction);
Collect(FinishedUpdates, {Active: 0})
)
);
This is How I am trying to patch the collection back to power apps:
Patch(
Deductions,
FinishedDeductions,
FinishedUpdates
);
The collections are being filled correctly and all looks good however I continue to get the same error in the patch function.
As far as I can tell, power apps documentation suggests this is doable:
Patch function in Power Apps (contains video) - Power Platform | Microsoft Learn.
Any thoughts on whats gone wrong?
Solved! Go to Solution.
Hey guys,
Not sure why but this started to work as expected after a couple days with no code changes.
Bit of a pain but here we are.
Hey guys,
Not sure why but this started to work as expected after a couple days with no code changes.
Bit of a pain but here we are.