Hi,
I have a report that is put into a collection in PowerApps after doing some calculations. The collection contains the SP List ID that will be updated along with a field value to be updated. When I am trying to update the SP List, it doesn't seem to be working.
My Collection is called colGTSSpent and the SPList is called Footprint.
If(AppliedMonth = "08",
ForAll(colGTSSpent,
Patch(Footprint,LookUp(Footprint,ID=Value(ID)),{GTSAUG: GTSAUG})
)
)
If I patch the record from the gallery it works OK but it takes forever as there are around 1000 records.
Any ideas?
Solved! Go to Solution.
Hi @StephCORKING ,
No the {ID:aPatch.ID} is the LookUp, but stated more directly.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @StephCORKING ,
A bit of ambiguity to be fixed - I assume ID is numeric in the collection
If(
AppliedMonth = "08",
ForAll(
colGTSSpent As aPatch,
Patch(
Footprint,
{ID:aPatch.ID),
{GTSAUG: aPatch.GTSAUG}
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @WarrenBelz
Yes, ID is a numeric value in the collection and it's the ID field from the SPList, and I renamed the collection items to begin with c. So it would would cID and cGTSAUG.
I'm a bit confused in your example. aPatch is a variable that I need to set?
Also, don't I need to get the matching record from the Footprint list by using a lookup?
Steph
No, it is a disambiguation tool - you cannot have field names the same in the source and target when patching.
Got it, thanks. I've changed the names in the collection.
Do I not need to include a lookup to the Footprint SP List to match the record to update? is including it in the patch as in your example, enough?
{ID:aPatch.ID), {GTSAUG: aPatch.GTSAUG}
Hi @StephCORKING ,
No the {ID:aPatch.ID} is the LookUp, but stated more directly.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @WarrenBelz
Thanks a lot for your help on this. It's working fine now (although it seems to run quite slowly)
Steph