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

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 III
Helper III

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 II
Helper II

just realised my error should be

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

LimeLeaf
Helper III
Helper III

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

---------------------------------------------------------------------------------------------------------------------------


Was I helpful? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. It will help other users to find it faster.

follow me on Twitter @zmansuri123,
connect with me on LinkedIn from Here

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,834)