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

Community site session details

Session Id : n+98QMOyGOMPtSNfWpi+95
Power Apps - Building Power Apps
Answered

Combobox multiple selection to filter a collection where columns are text fields

Like (0) ShareShare
ReportReport
Posted on 4 Mar 2024 11:11:59 by

 Hi all,

 

I'm having some trouble filtering a collection where the combobox allows multiple items to be selected. The key challenge here I think is that the data source. 

The SP list contains data on rates that companies can offer roles for. Each row contains the company name, role name, and the cost of that role. The combobox uses the role column to filter which is text and there are 165 different roles within the list. 

 

What I would like to happen is the user selects the roles they want to look recruit for and a collection is filtered as such that it only shows the companies that can deliver on ALL the roles selected. E.g., if I selected roles Business Analyst, Data Analyst, and Project Manager then my collection would show Company A, D, and F as they are the companies that can deliver on all the roles. 

 

I have got it to work when selecting a single role as below:

 

 

ClearCollect(
 colSuppliers,
 Filter(
 'Rate Card Comparison',
 Role = Suppliercap_combo.Selected.Value || Suppliercap_combo.Selected.Value = Blank()
 /*!(false in ForAll(
 Suppliercap_combo.SelectedItems,
 ThisRecord.Value in Role
 )) */
 )
);

 

 

There is also a few lines of code I have commented out but attempted to use to no success.

 

TIA 

  • JamesOwen Profile Picture
    on 04 Mar 2024 at 20:14:15
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Does this method only work if the items are selected in a specific order then?

  • v-mengmli-msft Profile Picture
    on 04 Mar 2024 at 15:42:22
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Hi @JamesOwen ,

     

    Please try this:

    ClearCollect(
     colSuppliers,
     Filter(
     AddColumns(GroupBy('Rate Card Comparison',"CompanyColumnName","Role"),"test",Concat(ThisRecord.Role,Role,",")),
     test = Concat(Suppliercap_combo.SelectedItems,Value,",") || IsEmpty(Suppliercap_combo.SelectedItems)
     ,CompanyColumnName
     )
    );

     

     

    Best regards,

    Rimmon

  • JamesOwen Profile Picture
    on 04 Mar 2024 at 15:20:37
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Role column is text - there is a row per role per supplier. 

     

    So I want to filter suppliers that can deliver all selected roles in the combo box. The table below shows the shape of the data source so hopefully that makes more sense. The reason for this structure as each row also contains the cost of each role which obviously varies by company.

     

    Company NameRole Name
    Company ABusiness Analyst
    Company BBusiness Analyst
    Company CBusiness Analyst
    Company AData Analyst
    Comapany BData Analyst
    Company APowerBI Dev
    Company CPowerBI Dev
  • v-mengmli-msft Profile Picture
    on 04 Mar 2024 at 14:52:06
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Hi @JamesOwen ,

     

    Do you meant that a company can provide multiple roles? 

     

    What is the type of role column? Do you want to find company which can provide all selected role in combo box?

     

    If it is a text column, what symbol is used to separate each role.

     

    Best regards,

    Rimmon

     

  • JamesOwen Profile Picture
    on 04 Mar 2024 at 14:22:11
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Hi @v-mengmli-msft ,

     

    I just realised that I know why I disregarded this method previously. It's because the collection is filtered such that is shows Companies who can provide one of the roles selected rather than ALL.

     

    E.g., I have selected role 1 and 2

     

    The collections currently working to show companies who can do either role 1 or 2 instead of just companies who can do role 1 AND role 2.

     

    Any ideas?

     

    Thanks,

    James

  • v-mengmli-msft Profile Picture
    on 04 Mar 2024 at 12:16:57
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Hi @JamesOwen ,

     

    The 'RoleColumn' is an assumption that is to prevent Combobox.SelectedItems returning a table with multiple columns. If your app does not need it, you can of course not use it.

     

    Best regards,

    Rimmon

  • JamesOwen Profile Picture
    on 04 Mar 2024 at 12:04:46
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Hi Rimmon,

     

    Thanks for your response - I did try this previously but must have not looked at the data properly as I didn't think it worked!

     

    Thanks so much - just a point though. It only required Combobox.SelectedItems and didn't like ".RoleColumn".

  • Verified answer
    v-mengmli-msft Profile Picture
    on 04 Mar 2024 at 11:42:33
    Re: Combobox multiple selection to filter a collection where columns are text fields

    Hi @JamesOwen ,

     

    When you select multiple choices in combo box, the value in combo box is a Table. I recommend you use in and ComboBox.SelectedItems to filter data source.

     

    Assuming that there is a RoleColumn in Items of combo box, please try this.

    ClearCollect(
     colSuppliers,
     Filter(
     'Rate Card Comparison',
     Role in Suppliercap_combo.SelectedItems.RoleColumn || IsEmpty(Suppliercap_combo.SelectedItems)
     /*!(false in ForAll(
     Suppliercap_combo.SelectedItems,
     ThisRecord.Value in Role
     )) */
     )
    );

     

     

    Best regards,

    Rimmon

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete