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
Solved! Go to Solution.
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:
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,
@Grichardson you need to use Filter function with Contains function in its expression.
Filter(PeoplePickerSource, !("@guestcompany.au" in FieldWithMailAddress))
How (with what code) are you currently populating your list of users (before filtering)?
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:
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,
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
Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.
Did you miss the call?? Check out the Power Apps Community Call here!
User | Count |
---|---|
268 | |
209 | |
76 | |
43 | |
35 |
User | Count |
---|---|
347 | |
225 | |
118 | |
72 | |
54 |