Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Nested For All Loops

(1) ShareShare
ReportReport
Posted on by 58
Hi 
 
I have a canvas app in which I am trying to eliminate the duplication of participants in a session:
 
 
I have a collection of the existing participants and then I want to loop through this and within this loop, loop through the selected items of a combo box and see if the values are the same, and if they are don't add them 
 
I can't figure out how to reference the first collection within the second part of the loop:
 
ForAll(colParticipants,ForAll(GroupWorkAddYP.SelectedItems,If(ThisRecord.YPID=colParticipants.Value)))
 
 
Any advice is appreciated
 
 
 
  • Verified answer
    WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Nested For All Loops
    This will get the selected items in the drop-down that are not in the collection. 
    Filter(
       GroupWorkAddYP.SelectedItems,
       !(YPID in colParticipants.Value)
    )
    Are you wanting to then add them to the collection ?
    ForAll(
       Filter(
          GroupWorkAddYP.SelectedItems,
          !(YPID in colParticipants.Value)
       ),
       Patch(
          colParticipants,
          {Value: YPID}
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard