cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sachinsoni441
Helper II
Helper II

Display user in people picker combo box

Hello experts, 

 

I have comma separated group of email id's which stored in set variable. my app also have people picker control which displays office 365 user. I want to set default selected user's in people picker, which all present in variable.

 

Example: Variable has below string.

 

rozer.s@abc.com, gerry.sal@abc.com, park.b@abc.com

 

I want to set these email id user as default selected users in people picker, how can i achieve this..

 

Please Help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

@sachinsoni441 

Try setting the DefaultSelectedItems property of your combo box to 

Filter(Office365Users.SearchUser({top: 999}).Mail, Mail in Split(yourVariableName,", "))

 

Note: my Office365 User list is more than 999 records and I wasn't able to return any emails/names beyond that limit. The Max you can set Top to in a combobox is 999 so there's a limit there. If your User list is greater than 999 records then you may need to look at creating a collection of users or a data source (eg SharePoint List, SQL db, etc) which holds all the user details and use this as your reference?

 

Let me know how you get on

View solution in original post

10 REPLIES 10
eka24
Super User
Super User

Use this on the combobox items:
["rozer.s@abc.com", "gerry.sal@abc.com", "park.b@abc.com"]

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Anonymous
Not applicable

@sachinsoni441 

Is your People Picker a ComboBox? If so, what is the Items property you are using?

 

Edit: Also, just to double check, you are looking to select multiples, yes?

Hello @Anonymous

 

I have use combo box people picker and set below formula to the item property.

 

Office365Users.SearchUser({searchTerm:ComboBox2.SearchText})

 

Which displays office 365 users and on button click i stored all selected users email in JSON file, I reload that JSON data on screen visible to per-populate in same people picker.

 

Note: JSON Stores email id in comma separated string.

 

Please advice!

Anonymous
Not applicable

@sachinsoni441 

Try setting the DefaultSelectedItems property of your combo box to 

Filter(Office365Users.SearchUser({top: 999}).Mail, Mail in Split(yourVariableName,", "))

 

Note: my Office365 User list is more than 999 records and I wasn't able to return any emails/names beyond that limit. The Max you can set Top to in a combobox is 999 so there's a limit there. If your User list is greater than 999 records then you may need to look at creating a collection of users or a data source (eg SharePoint List, SQL db, etc) which holds all the user details and use this as your reference?

 

Let me know how you get on

Hi @Anonymous 

 

I have use below formula in defaultSelectedItems property of combo box

 

Filter(Office365Users.SearchUser({top:999}).Mail, Mail in Split(MyEmails,", "))

MyEmails variable contain multiple email id's but still its not showing in combo box.

Anonymous
Not applicable

@sachinsoni441 

Using your Combo box, select the first two Emails that appear in the list, don't search for any emails. Put these two emails into MyEmails. Does this work?

@Anonymous 

 

I have use same process which you provided, but still not working.

 

Please let me know, if any other information required.

Anonymous
Not applicable

@v-yutliu-msft 

Do you have any suggestions?

Anonymous
Not applicable

@WarrenBelz  can you offer any suggestions here?

@v-yutliu-msft hasn't answered as yet.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,928)