cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Filter people picker list

Hi,

I have a people picker field on my form currently it shows all users in my domain.  I only want to show some of the users listed not all.  The users have different email one is @company.au and the other is @guestcompany.au.  Is there a way to stop @guestcompany.au from appearing in the people picker list when a user is typing a name into the search field?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Filter people picker list

Hi @Grichardson,

Could you please share a bit more about the formula you typed within the Items property of the People Picker Combo Box control? Is it "Choices('YourSPList'.YourPersonColumn)"?

Could you please share a bit more about your data source? Is it a SP list?

I assume that your data source is a SP list, and there is a Person type column within it, is it true?

I have made a test on my side, if you want to filter your People Picker Combo Box directly within your Edit form, I afraid that there is no way to achieve your needs in PowerApps currently.

As an alternative solution, please take a try with the following workaround:6.JPG

Firstly, you need to add a Office 365 Users connector within your app.

Set the Items property of the Combo Box within the People field Data card to following:

Filter(Office365Users.SearchUser({searchTerm: DataCardValue8.SearchText}), "Test" in Mail) /* <-- DataCardValue8 represents the Combo Box within my People field Data card in my Edit form */

On your side, you should type:

Filter(Office365Users.SearchUser({searchTerm: PeoplePickerComboBox.SearchText}), Not("@guestcompany.au" in Mail)) /* <-- PeoplePickerComboBox represents the Combo Box control within your People field Data card in your Edit form */

then re-configure the Primary text, Secondary text and SearchField property of the People Picker Combo Box as above screenshot.

Set the IsSearchable property of the Combo Box to following:

true

Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/People-Picker-filter/td-p/102675

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Filter people picker list

@Grichardson you need to use Filter function with Contains function in its expression.

Highlighted
Anonymous
Not applicable

Re: Filter people picker list

Filter(PeoplePickerSource, !("@guestcompany.au" in FieldWithMailAddress))

Highlighted
Frequent Visitor

Re: Filter people picker list

Hi Cvdk

I was trying something like you have suggested, but I am not sure what ‘FieldWithMailAddress’ should be. My understanding is the list of users is from AD. I am unsure how to single out the email address from the information I am pulling from AD.
Highlighted
Anonymous
Not applicable

Re: Filter people picker list

How (with what code) are you currently populating your list of users (before filtering)?

Highlighted
Community Support
Community Support

Re: Filter people picker list

Hi @Grichardson,

Could you please share a bit more about the formula you typed within the Items property of the People Picker Combo Box control? Is it "Choices('YourSPList'.YourPersonColumn)"?

Could you please share a bit more about your data source? Is it a SP list?

I assume that your data source is a SP list, and there is a Person type column within it, is it true?

I have made a test on my side, if you want to filter your People Picker Combo Box directly within your Edit form, I afraid that there is no way to achieve your needs in PowerApps currently.

As an alternative solution, please take a try with the following workaround:6.JPG

Firstly, you need to add a Office 365 Users connector within your app.

Set the Items property of the Combo Box within the People field Data card to following:

Filter(Office365Users.SearchUser({searchTerm: DataCardValue8.SearchText}), "Test" in Mail) /* <-- DataCardValue8 represents the Combo Box within my People field Data card in my Edit form */

On your side, you should type:

Filter(Office365Users.SearchUser({searchTerm: PeoplePickerComboBox.SearchText}), Not("@guestcompany.au" in Mail)) /* <-- PeoplePickerComboBox represents the Combo Box control within your People field Data card in your Edit form */

then re-configure the Primary text, Secondary text and SearchField property of the People Picker Combo Box as above screenshot.

Set the IsSearchable property of the Combo Box to following:

true

Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/People-Picker-filter/td-p/102675

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Filter people picker list

Hi @Grichardson,

 

If in PowerApps Studio you add an New Screen and select the screen type 'Email', it has a great example of a way to pick people from your Azure AD domain based on the Office365Users connector.

It contains a galley called 'PeopleBrowseGallery1' this has the following formula:

 

If(!IsBlank(Trim(TextSearchBox1.Text)), Office365Users.SearchUser({searchTerm: Trim(TextSearchBox1.Text), top: 15}))

 

If you change this to the following, it will find the first 15 users based on the searchterm that was entered into TextSearchBox1, but only if the user does not have "@guestcompany.au" in it's mailadres.

 

If(!IsBlank(Trim(TextSearchBox1.Text)),Filter(Office365Users.SearchUser({searchTerm: Trim(TextSearchBox1.Text), top: 15}),!("@guestcompany.au" in Mail)))

 

You can increase the number of users it returns by changing the value for "top:", but not higher than 999. At least for me it failed returning anything if set to 1000 or above.

 

Hope this helps.

Kr,

Casper

Highlighted
Helper I
Helper I

Re: Filter people picker list

@v-xida-msft  HI, how does one add multiple emails to be added to be searched?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published 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,102)