web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collection to update e...
Power Apps
Answered

Collection to update existing sharepoint list item

(0) ShareShare
ReportReport
Posted on by 203

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?

Categories:
  • WarrenBelz Profile Picture
    156,520 Most Valuable Professional on at

    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.

  • StephCORKING Profile Picture
    203 on at

    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

  • WarrenBelz Profile Picture
    156,520 Most Valuable Professional on at

    @StephCORKING ,

    No, it is a disambiguation tool - you cannot have field names the same in the source and target when patching.

  • StephCORKING Profile Picture
    203 on at

    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}
  • Verified answer
    WarrenBelz Profile Picture
    156,520 Most Valuable Professional on at

    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.

  • StephCORKING Profile Picture
    203 on at

    Hi @WarrenBelz 

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

     

    Steph

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard