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 / Creating a collection ...
Power Apps
Unanswered

Creating a collection with a for all on a table and retrieving data from a different table

(0) ShareShare
ReportReport
Posted on by

Hello, I have two Sharepoint list:

  • "Events" with a String column "Participants" where there are the emails of the participants separated by ","
  • "Users" with a String column "Email" and a User column "User" (useful to get picture, displayname etc)

     

    What i want to achieve is to have a collection of objects with two columns: User (which will contain the Object User)andStatus (which will be just a static string "willPartecipate").The users should be all the partecipants specified in the Event SP list, but the User object should be grabbed on the Users SP list

     

     

    I tried this way:
    - generated a table of all partecipants with a split on the Partecipants column of Events SP list (which generates a table with a Value column)
    - looped in the table with a for all
    - added the user inside a collection with a lookup on the Users SP list

     

    this is my code

 

 

ForAll(
 Split(
 LookUp(Events, EventID = varID).Participants,
 ","
 ),
 Collect(
 List,
 {
 User:LookUp(Users,Email=ThisRecord.Value).User, 
 Attend: "yes"
 }
 )
)

 

 

the problem is that inside the collection ThisRecord.Value isn't recognized as the ThisRecord seems to be linked to the Users table. how can i refer to the Item that i'm looping on?
how to fix?

 

thank you so much

 

p.s. i'm aware that i shouldn't use the list of emails inside a string, but it's a requirement i have to deal with

Categories:
I have the same question (0)
  • Anchov Profile Picture
    1,986 on at

    Try something like this:

    ForAll(
     Split(
     LookUp(Events, EventID = varID).Participants,
     ","
     ) As userEmail,
     Collect(
     List,
     {
     User:LookUp(Users,Email=userEmail).User, 
     Attend: "yes"
     }
     )
    )

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard