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 choices column

(0) ShareShare
ReportReport
Posted on by 125

Hi,

 

I have seen similar post but for choice columns

 

I have a choices column and want to be able to filter using multi-select on a combo box.  I don't want to create tick boxes as shown in this video Power Apps filter multiple selections - Exact or All options - Try again - Bing video as the list of selections will be too long on the screen.

 

So I have a choices column of USStates and several states can be collected but I also want to search for several different states being chosen by using a combobox that has the same choices (USStates).

 

At the moment I have

Filter(MyTable, USStates in ComboBox4.SelectedItem.Value) - This only filters by  the last(most recently) selected item and not all sleected. So I tried, 

 

ForAll (ComboBox.SelectedItems, Filter(MyTable, USStates in ComboBox4.SelectedItem.Value)) mbut then I just get true/false values.

 

Any ideas?  I am really new to powerapps and still figuring out the filtering.

 

Thanks

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MichelleH 

    Yes, please consider changing your Formula to the following:

    Filter(MyTable, USStates in ComboBox4.SelectedItems.Value)

     

    SelectedItem - is a single selected record

    SelectedItems - is a table of all the selected records.

     

    I hope this is helpful for you.

  • MH-02091453-0 Profile Picture
    125 on at

    Thanks for the reply.  yes, I tried this and just tried again to check...unfortunately  it shows an error over USStates saying invalid argument: cannot use table values in this context.  My USStates is a CHOICES column?  any ideas?

  • v-yujincui-msft Profile Picture
    Microsoft Employee on at

    Hi @MichelleH,

     

    Do you want to use Combo Box to filter the Choice columns that allow multiple selections?

    I have made a test for your reference.

     

    1.Here is my SharePoint list.

    vyujincuimsft_0-1641351206523.png

     

    2.Add a Text Input Control.

    3.Add a Gallery Control and apply the following formula on its items property as:

    If(!IsEmpty(ComboBox1.SelectedItems),Filter(Filtertest,"yes" in ForAll(ComboBox1.SelectedItems,If(Value in Category.Value,"yes","no"))),Filtertest)

    Result Screenshots:

    vyujincuimsft_1-1641351206527.png

     

    Best Regards,

    Charlie Choi

  • MH-02091453-0 Profile Picture
    125 on at

    That is amazing thank you, before it was giving me true/false values in the gallery now it gives the actual values.  Is there anyway to make combobox filters as AND so to only retrieve the results where all they have ALL selecteditems?

     

    Thanks

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

    Hi @MichelleH ,

     

    Do you want to only retrieve the results where all they have ALL selecteditems?

    I have made a test for your reference. This formula can meet your matching needs in the case of multiple selection. Do you also want an exact match in the case of single selection?

     

    Select the Gallery Control and apply the following formula on its items property as:

    Filter(Filtertest,CountIf(ForAll(ComboBox2.SelectedItems As CS,If(CS.Value in Category.Value,"yes","no")),"yes" = Value )>=CountRows(ComboBox2.SelectedItems))

    Result Screenshots:

    vyujincuimsft_0-1641462840973.png

     

    vyujincuimsft_1-1641462840977.png

     

    Best Regards,

    Charlie Choi

  • MH-02091453-0 Profile Picture
    125 on at

    Thank you Charlie,

     

    I was wondering if there is some way to find if the length of the combo box selected items was greater or same as the number of values (choices), that solution is perfect.  Wish I new more of the syntax like you!🙂  I will keep learning.  Thank you again

  • MH-02091453-0 Profile Picture
    125 on at

    I am wondering how apply the same type formula in a situation where you are using a combo box to filter  in a custom many to may situation?

     

    So I have

     

    ClearCollect(fourthCollection, ForAll(Filter(Skills, Skills.SkillName in ComboBox6.SelectedItems.SkillName), Student));

     

    This collects all the students who have ANY of the skill with the name in selectedin the items in the combo box.

     

    There are  tables student (1 - many|) Student_skills (many to one) SkillNames (the name column is a text column) I used the SkillNames to populate the combox by having its items as SkillNames ( table name)

     

    Thanks

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-yujincui-msft ,

     

    I was stuck in a similar situation and your solution was really helpful but I need to use multiple combo boxes as filters for my gallery. I tried using the same formula with little tweaks as listed below.

     

    If(!IsEmpty(ComboBox1.SelectedItems),Filter(Filtertest,"yes" in ForAll(ComboBox1.SelectedItems,If(Value in Category.Value,"yes","no"))),
    If(!IsEmpty(ComboBox2.SelectedItems),Filter(Filtertest,"yes" in ForAll(ComboBox2.SelectedItems,If(Value in 'Category2'.Value,"yes","no"))),
    If(!IsEmpty(ComboBox3.SelectedItems),Filter(Filtertest,"yes" in ForAll(ComboBox3.SelectedItems,If(Value in 'Category3'.Value,"yes","no"))),
    If(!IsEmpty(ComboBox4.SelectedItems),Filter(Filtertest,"yes" in ForAll(ComboBox4.SelectedItems,If(Value in 'Category4'.Value,"yes","no"))),
    Filtertest))))

     

    The filters worked well, but my gallery shows nothing when I initially enter the screen and none of the filters are selected. Can you point me in the right direction? I am not sure where did I go wrong!

     

    Thanks

  • TanajiChavan Profile Picture
    4 on at

    This has worked perfect for me. Thanks for sharing this solution.

  • cammic Profile Picture
    6 on at

    This is a great solution BUT I replicated this example exactly and still cannot get the filter results I need. For example, in my Combobox I select "Fruit" and "Cheap" I got SharePoint items where the Choices have Fruit + Cheap BUT how can I filter and find records where the Category contains "Fruit" and/or "Cheap". Thanks

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard