web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using a combobox to fi...
Power Apps
Answered

Using a combobox to filter on a LookUp (Multiple) column

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I've been looking through other posts about this subject but have not been able to solve my issue. 
I have a SharePoint List with a LookUp column named 'Tags', that is mapped to another SharePoint List that contains the actual tags (this is for an app to tag employees within our company with certain capabilities). I also added the tags 'Title' as a separate column:

ReinderSentia_0-1614612337004.png

Tags list in Sharepoint:

ReinderSentia_1-1614612426682.png

 

Now when I use a combobox with all the different tag values to filter my employees, I cannot get multiple values to work correctly. 
I can get one tag in my gallery filter to work correctly, like so:

 

 

Filter('Employees list', Value(TextInput4.Text) in Tags.Id)

 

 

But cannot get multiple tags to filter my gallery succesfully. Here's some stuff I tried:

Filter on gallery:

 

 

Filter('Employees list', ComboBox.SelectedItems.ID in Tags)

 

 

Creating a collection as a datasource for my gallery:

 

Clear(FilteredOnTagsCollection);
ForAll(
 ComboBox.SelectedItems,
 Collect(
 FilteredOnTagsCollection,
 Filter(
 'Employees list',
 ThisRecord.ID in ShowColumns(
 Tags,
 "Id"
 )
 )
 )
)

 

(this actually does something, but when searching with only one tag I do see employees in the results that do not have that tag)

 

Is this even possible? How can i filter on a multiple LookUp column using a combobox?

 

Cheers
Reinder

Categories:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     


    According to your description, I've made a test for your reference:

     

    1\ This is my list 'Employees list'. 'Tags' is a lookup column. It allows multiple selection.

    v-xiaochen-msft_0-1614665193512.png

     

    2\ This is my list 'Tags'.

    v-xiaochen-msft_1-1614665220074.png

     

    3\ Add a combo box control 'ComboBox1' and set its Items property to:

    Choices('Employees list'.Tags)

     

    4\ Add a gallery control and set its Items property to:

    Filter(ForAll('Employees list' As Test1,If(CountRows(Filter(ForAll(ComboBox1.SelectedItems As Test2,If(Test2.Value in Test1.Tags.Value,Test2,Blank())),!IsBlank(Value)))>0,Test1,Blank())),!IsBlank(Title))

     

    5\ The result is as follows:

    v-xiaochen-msft_2-1614665392783.png

    v-xiaochen-msft_3-1614665500665.png

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @v-xiaochen-msft , that already works quite a lot better.


    However, I have 2 questions:

    - how can I have the combobox show the actual Title value of the tags? It now shows the ID of the tags...

    - it looks like choosing multiple tags works like an 'OR' expression, but I need it to be an 'AND' expression: the employees in the results should have all of the chosen tags in the combobox.

     

    Thanks
    Reinder

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    1\ Please modify the Items property of 'ComboBox1' control to :

    Tags

     

    2\ Please modify the Items property to of the gallery control to:

    Filter(ForAll('Employees list' As Test1,If(CountRows(Filter(ForAll(ComboBox1.SelectedItems As Test2,If(Test2.ID in Test1.Tags.Value,Test2,Blank())),!IsBlank(ID)))=CountRows(ComboBox1.SelectedItems) ,Test1,Blank())),!IsBlank(Title))

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @v-xiaochen-msft , that works like a charm!
    You provided some nice insights in how to work with ForAll inside a filter 🙂

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard