cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andrew260z1
Helper II
Helper II

Filter a gallery with multiple values in combobox

I've had a look at some other posts but the scenario doesn't quite match what I'm trying to do here; I have an existing Gallery that I'm filtering the full Items statement is: 

SortByColumns(Filter('Tracking List',('Cargo Type' = ddStatusValue.Selected.Value || ddStatusValue.Selected.Value = "* All"),(Assigned.DisplayName=Dropdown_Creator.Selected.Result || Dropdown_Creator.Selected.Result= "* All"),If( Checkbox1.Value=true, 'ETD (dd-mm-yyyy)' >= dateFrom.SelectedDate && 'ETD (dd-mm-yyyy)' <= dateTo.SelectedDate, true ) && ('Freight Status' = Dropdown_ShipmentStatus.Selected.Result || Dropdown_ShipmentStatus.Selected.Result = "* All"),If(FromTerm,ddCountryFilter.Selected.Title in Country,true), If(!IsBlank(txtWONum),StartsWith('WO NUMBER',txtWONum.Text),StartsWith('OB NUMBER',txtOBNum.Text))),"ID",If(SortDescending1,Ascending, Descending))

 

I have a combo box ddCountryFilter that the users would like to match against country values in the list (but allow multiple selections). I see concatenate might be a way to do it but I've not been able to wrap my head around how it works.. is it possible?

 

1 ACCEPTED SOLUTION

Accepted Solutions
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Andrew260z1 ,

if you want to filter the gallery based on multiple selections then you can use the code like below.

SortByColumns(Filter(AddCOlumnsColl,Status.WeekStart>=DateValue(Text(DP_StartWeek_3.SelectedDate))&&Status.WeekEnd<=DateValue(Text(DP_EndWeek_3.SelectedDate)) && Status.Status.Value in CB_StatusByFilter_1.SelectedItems.Result && ProjectName in CB_ProjectByFilter_1.SelectedItems.Result && UserName in CB_UserByFilter_1.SelectedItems.Result && 'Work Type'.Value in CB_WorkTypeFilter_1.SelectedItems.Result),"MasterID",If(SortDescending1,Descending,Ascending)),

 

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Please Vote for my idea if you feel, that will help you in the future or good to have in power app.
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Ability-s-to-Select-Icon-from-UIFabric/idi-p/69...

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Preview-Mode-for-All-the-Device-Like-Phone-Tabl...

View solution in original post

3 REPLIES 3
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Andrew260z1 ,

if you want to filter the gallery based on multiple selections then you can use the code like below.

SortByColumns(Filter(AddCOlumnsColl,Status.WeekStart>=DateValue(Text(DP_StartWeek_3.SelectedDate))&&Status.WeekEnd<=DateValue(Text(DP_EndWeek_3.SelectedDate)) && Status.Status.Value in CB_StatusByFilter_1.SelectedItems.Result && ProjectName in CB_ProjectByFilter_1.SelectedItems.Result && UserName in CB_UserByFilter_1.SelectedItems.Result && 'Work Type'.Value in CB_WorkTypeFilter_1.SelectedItems.Result),"MasterID",If(SortDescending1,Descending,Ascending)),

 

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Please Vote for my idea if you feel, that will help you in the future or good to have in power app.
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Ability-s-to-Select-Icon-from-UIFabric/idi-p/69...

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Preview-Mode-for-All-the-Device-Like-Phone-Tabl...

v-qiaqi-msft
Community Support
Community Support

Hi@Andrew260z1,

Based on the issue that you mentioned, do you want to filter the Gallery based on the multiple values from the ddCountryFilter selected?

Could you please share a bit more about the scenario:

  1. Is the corresponding column to the ddCountryFilter a Text or Choice type column, how you set the Items property of the ddCountryFilter?
  2. More details about your data source and app configuration.

I have a test on my side, please take a try as below.

Based on the formula you provided, I assume that the Country column is a Text type:

Set the Items property of the ddCountryFilter as below:

 

Distinct(FlooringEstimates,Category)

 

Set the Items property of the Gallery as below:

 

Filter(FlooringEstimates,Category in ComboBox1.SelectedItems.Result)

 

Note: Replace the data source and column name with yours.

Best Regards,

Qi

Best Regards,
Qi

This does work thanks - however will show no items when blank, but yes it will filter multiple OK now. 

 

Andrew260z1_0-1601365263711.png

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,969)