i have a SharePoint List('Admin Users') which basically has one column that is a people field(User). i want to be able to extract the emails into the app as a Table with one column where each value is the email of the user.
Any ideas?
Solved! Go to Solution.
For example, let's say your SharePoint List 'Admin Users' looks like this. Username is a People type column.
Username |
Anne Black |
Kelly Johnson |
Jessica Finch |
To make a collection holding the email of each user you can use this code in the OnVisible property of the screen.
Clear(myEmailsList);
ForAll('Admin Users', Collect(myEmailsList,{Value: Username.Email}))
Now if you create a Data Table and put this code in the Items property...
myEmailsList
...The Data Table will look like this in your app.
Value |
ablack@yourcompany.com |
kjohnson@yourcompany.com |
jfinch@yourcompany.com |
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi @Gottijay2000 ,
Do you want to get a one column table where each value is the email addresses of the user in 'Admin Users'?
Can you tell me whether the person field(User) allows multiple people?
I’ve made a similar test for your reference:
Case 1: The person field(User) does not allow multiple people.
1\ Add a button control and set the control’s OnSelect property to:
Clear(Emailofusers); /* ‘Emailofusers’ is a collection that will be created by the following code*/ /*Clear the collection ‘Emailofusers’ before getting the data*/
ForAll( /*traversal each records of 'Admin Users'*/
'Admin Users',
Collect(
Emailofusers,
{emailaddress: User.Email} /*get the email of user*/ /*User is the column name of the people field(User)*/
)
)
2\ You will get a one column table(Emailofusers) where each value is the email of the user by clicking the button.
Case 2: The person field(User) allows multiple people.
1\ Add a button control and set the control’s OnSelect property to:
Clear(Emailofusers); /* ‘Emailofusers’ is a collection that will be created by the following code*/ /*Clear the collection ‘Emailofusers’ before getting the data*/
ForAll( /*traversal each records of 'Admin Users'*/
'Admin Users',
ForAll( /*traversal each records of ‘User’*/
User,
Collect(
Emailofusers,
{emailaddress: Email} /*get the email of user*/
)
)
)
2\ You will get a one column table(Emailofusers) where each value is the email of the user by clicking the button.
If you still have any question please don’t hesitate to let us know.
Best Regards,
For example, let's say your SharePoint List 'Admin Users' looks like this. Username is a People type column.
Username |
Anne Black |
Kelly Johnson |
Jessica Finch |
To make a collection holding the email of each user you can use this code in the OnVisible property of the screen.
Clear(myEmailsList);
ForAll('Admin Users', Collect(myEmailsList,{Value: Username.Email}))
Now if you create a Data Table and put this code in the Items property...
myEmailsList
...The Data Table will look like this in your app.
Value |
ablack@yourcompany.com |
kjohnson@yourcompany.com |
jfinch@yourcompany.com |
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hi @Gottijay2000 ,
Do you want to get a one column table where each value is the email addresses of the user in 'Admin Users'?
Can you tell me whether the person field(User) allows multiple people?
I’ve made a similar test for your reference:
Case 1: The person field(User) does not allow multiple people.
1\ Add a button control and set the control’s OnSelect property to:
Clear(Emailofusers); /* ‘Emailofusers’ is a collection that will be created by the following code*/ /*Clear the collection ‘Emailofusers’ before getting the data*/
ForAll( /*traversal each records of 'Admin Users'*/
'Admin Users',
Collect(
Emailofusers,
{emailaddress: User.Email} /*get the email of user*/ /*User is the column name of the people field(User)*/
)
)
2\ You will get a one column table(Emailofusers) where each value is the email of the user by clicking the button.
Case 2: The person field(User) allows multiple people.
1\ Add a button control and set the control’s OnSelect property to:
Clear(Emailofusers); /* ‘Emailofusers’ is a collection that will be created by the following code*/ /*Clear the collection ‘Emailofusers’ before getting the data*/
ForAll( /*traversal each records of 'Admin Users'*/
'Admin Users',
ForAll( /*traversal each records of ‘User’*/
User,
Collect(
Emailofusers,
{emailaddress: Email} /*get the email of user*/
)
)
)
2\ You will get a one column table(Emailofusers) where each value is the email of the user by clicking the button.
If you still have any question please don’t hesitate to let us know.
Best Regards,
THANK YOU GURU I have searched high and low for hours on how to get this exact answer - there is zero out there that I could find except for this post to ansewer "How to I collect the email adress of each person in a SharePoint list column of type'Person' where you can cave multiple users.
I registered just to kudos and reply as I am so very grateful. There is so little info on this, and if so, nothing with such a generous explanatory working sample.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
197 | |
69 | |
47 | |
36 | |
25 |
User | Count |
---|---|
239 | |
109 | |
89 | |
88 | |
66 |