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

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

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.

Eelman
Super User
Super User

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

@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

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.

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

@Eelman 

 

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

 

Please let me know, if any other information required.

@v-yutliu-msft 

Do you have any suggestions?

@WarrenBelz  can you offer any suggestions here?

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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (85,643)