cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User
Super User

Re: Display user in people picker combo box

@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
Highlighted
Super User
Super User

Re: Display user in people picker combo box

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.

Highlighted
Super User
Super User

Re: Display user in people picker combo box

@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?

Highlighted
Helper II
Helper II

Re: Display user in people picker combo box

Hello @Eelman

 

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!

Highlighted
Super User
Super User

Re: Display user in people picker combo box

@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

Highlighted
Helper II
Helper II

Re: Display user in people picker combo box

Hi @Eelman 

 

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.

Highlighted
Super User
Super User

Re: Display user in people picker combo box

@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?

Highlighted
Helper II
Helper II

Re: Display user in people picker combo box

@Eelman 

 

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

 

Please let me know, if any other information required.

Highlighted
Super User
Super User

Re: Display user in people picker combo box

@v-yutliu-msft 

Do you have any suggestions?

Highlighted
Super User
Super User

Re: Display user in people picker combo box

@WarrenBelz  can you offer any suggestions here?

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

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,848)