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 / Combobox multiple sele...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on 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 

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

    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

  • JamesOwen Profile Picture
    on at

    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".

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

    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 at

    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
    Microsoft Employee on at

    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 at

    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
    Microsoft Employee on at

    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 at

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

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard