cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sifu
Responsive Resident
Responsive Resident

People picker with search and filter

Hi guys, i just did a combobox with the search for people but having issue with the fact that it always shows me the "departments" when i just click into the field to start search...
Office365Users.SearchUserV2({searchTerm:manager.SearchText,top:5}).value.DisplayName

Sifu_0-1607707053458.png

 

one way around would be to use the older version of search with a filter:

Filter(Office365Users.SearchUser({searchTerm:manager.SearchText,top:5}), Not("Department" in DisplayName)).DisplayName

my question is, is this a good way to do the filter? is there any possibility to filter it with the SearchUserV2 ... I could not found any documentation on this...

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@Sifu 

Are you stating the you have user display names like "Department, 2001, etc" or that your combobox is only showing department values?

 

I believe it is the former that is the problem and yes, you can use the filter, but there is no need to revert to the deprecated SearchUser function, the filter will work fine on V2.

   Filter(Office365Users.SearchUserV2({searchTerm:manager.SearchText,top:5}).value, !("Department" in DisplayName)).DisplayName

 

Also keep in mind that the trailing "DisplayName" on that formula will be limiting your items to only have display name.  If you want to be able to access other properties of the selected person in your list, I would advise removing that.

Also, keep in mind that your results are limited in your search to the top 5.  You may want to adjust that as, if the search returns 5 users and all 5 have department in the displayName, then your combobox will be empty!

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

1 REPLY 1
RandyHayes
Super User III
Super User III

@Sifu 

Are you stating the you have user display names like "Department, 2001, etc" or that your combobox is only showing department values?

 

I believe it is the former that is the problem and yes, you can use the filter, but there is no need to revert to the deprecated SearchUser function, the filter will work fine on V2.

   Filter(Office365Users.SearchUserV2({searchTerm:manager.SearchText,top:5}).value, !("Department" in DisplayName)).DisplayName

 

Also keep in mind that the trailing "DisplayName" on that formula will be limiting your items to only have display name.  If you want to be able to access other properties of the selected person in your list, I would advise removing that.

Also, keep in mind that your results are limited in your search to the top 5.  You may want to adjust that as, if the search returns 5 users and all 5 have department in the displayName, then your combobox will be empty!

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

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 (30,430)