Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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 

  • JamesOwen Profile Picture
    on at
    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 at
    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 at
    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 at
    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 at
    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 at
    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 at
    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 at
    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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard