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
Does this method only work if the items are selected in a specific order then?
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
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.
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
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
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
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".
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
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2