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 / Need help patching yes...
Power Apps
Answered

Need help patching yes/no list entries while using a collection of IDs

(0) ShareShare
ReportReport
Posted on by 58

Hi guys,

 

I came along with the following problem:

I have collection (CollID) containing several IDs (these IDs are the linked IDs of a contact list).

Iam now trying to patch the yes/no  column (called: "VI") in the contact list where the saved IDs of the collection are matched.

I tried:

 

ForAll(CollID;Patch(contact;LookUp(contact;ID=ID);{VI:true}))

 

However, that does not work. Does anyone of you have an idea?

 

Greetings René

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @IamTrying 

    To start, your formula has the ForAll backward. You are trying to use it like a ForLoop in some development language - which PowerApps is not.  ForAll is a function that returns a table of records based on your iteration table and record schema.

    It is more efficient to use the function as intended and will provide better performance.

     

    In your formula, the ID=ID is what is causing your issue.

     

    However, your formula should be the following:

    Patch(contact; 
     ForAll(CollID;
     {ID: ID;
     VI:true
     }
     )
    )

    There is no need to re-lookup record based on the ID...you already have the ID and that is all that Patch needs - the primary key!

    This was also another extreme performance killer in your formula with the ForAll backward... not only was Patch needing to be instantiated many times, but each also needed a LookUp multiple times.

     

    I hope this is helpful for you.

  • IamTrying Profile Picture
    58 on at

    Hey RandyHayes,

     

    that makes sense and it does work perfectly. Thank you so much!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @IamTrying 

    No problem!  Happy to help!

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
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard