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

Unable to Patch a collection to a Sharepoint List

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. 

 

Constrictor64_0-1669268519059.png

 

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Constrictor64
Helper I
Helper I

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.

View solution in original post

1 REPLY 1
Constrictor64
Helper I
Helper I

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.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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