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

Notifications

Announcements

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard