cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StephCORKING
Helper III
Helper III

Collection to update existing sharepoint list item

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

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

@StephCORKING ,

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.

View solution in original post

Hi @WarrenBelz 

Thanks a lot for your help on this.   It's working fine now (although it seems to run quite slowly)

 

Steph

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,376)