cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MJ84
Helper I
Helper I

Filtering Searchable items in a combobox

Hi all,

 

I have the below in a combobox Items property to pull user data from AD I am then using the distinct function to remove duplicate displaynames and filtering on the company name to only include certain companies......... This works fine with the Filter but as soon as I add the distinct function it breaks.... Any pointers would be welcome!

 

Filter(Distinct(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),DisplayName),"Company1" in CompanyName Or "Company2" in CompanyName)

1 ACCEPTED SOLUTION

Accepted Solutions
LimeLeaf
Helper II
Helper II

Hi @MJ84,

ya this i exactly what i was thinking about. 
Don't filter the distinct selection - use distinct on the filtered result.

Does it work?

View solution in original post

3 REPLIES 3
MJ84
Helper I
Helper I

just realised my error should be

Distinct(Filter(Office365Users.SearchUser({searchTerm:ComboBox1.SearchText}),"company1" in CompanyName Or "company2" in CompanyName),DisplayName)

LimeLeaf
Helper II
Helper II

Hi @MJ84,

ya this i exactly what i was thinking about. 
Don't filter the distinct selection - use distinct on the filtered result.

Does it work?

zmansuri
Super User
Super User

a3.jpg

 

When you use Distinct it created a table with single column with "Result" as header. In that table you are searching for company. Which is not available. So i think @MJ84 's code will work for you

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,408)