Power Apps combo box filter

Would you like to do a filter with Power Apps Combo Box control or want to see a few examples of Power Apps combo box filter? If that’s the case, this Power Apps tutorial will teach you how to filter using the Power Apps Combo Box control in various scenarios. such as:

  • power apps combo box filter gallery
  • powerapps filter combo box selected items
  • Power Apps filter gallery multiple combo boxes
  • powerapps combo box distinct filter
  • power apps filter combo box empty value
  • Power Apps combo box filter collection
  • powerapps filter data table with a combo box
  • power apps combo box filter office 365 users

Power Apps combo box filter

A combo box control typically contains the items that can be selected. To display the filtered data while working with the filter function in the Power Apps combo box, we must use a Power Apps gallery or data table.

In the examples that follow, we will use a combo box control to display the options or items, and a gallery or data table to display the filtered items based on the combo box control’s selected item (s).

Power Apps Combobox filter gallery

Here we will see how to filter a gallery based on the Power Apps combo box selection. That means when the user selects any item from the combo box, the gallery will be filtered as per the selected item. To work with this requirement, the following steps are:

  • Suppose, we have a SharePoint list having some columns like the below:

(Title, SoldDate- date and time, Qty- Number, Color- choice, Payment Mode- choice)

power apps combobox filter gallery
powerapps Combobox filter gallery
  • Using the above SharePoint list let’s build a gallery on the Power Apps screen shown below:
powerapps filter combobox sharePoint list
powerapps filter Combobox SharePoint list
  • Next, add a combo box control to the screen and insert the expression on the combo box’s Items property to display the choices in the control. Suppose, we want to display the choices of the ‘Payment mode’ column.
Items = Choices(BikeSales.'Payment Mode')
  • To filter this gallery based on the combo box selected item, insert the below filter query within the gallery’s Items property.
Items = Filter(BikeSales, 'Payment Mode'.Value = Cmb_PaymentMode.Selected.Value)

Where,

  1. BikeSales: The name of the SharePoint list
  2. ‘Payment Mode’.Value: As the ‘Payment Mode‘ is the choice column, so it is denoted as ‘Payment Mode’.Value.
  3. Cmb_PaymentMode: The name of the combo box control.
PowerApps combo box filter choices
PowerApps combo box filter choices

Let’s save and publish the app. Play it in preview mode and select any choice from the combo box control. (Ex-Advance Payment). We can see the filtered items will be displayed in the Power Apps gallery below:

PowerApps combo box filter items
PowerApps combo box filter items

This demonstrates how to use SharePoint items to filter a Power Apps gallery based on the combo box selection.

Read Power Apps Combo box with SharePoint list

Power Apps filter Combo box selected items

In the above example, we have seen how to filter the Power Apps gallery based on a combo box with the selected item. But here, we will see how to work with filtering a Power Apps combo box for selected items or multiple selected items.

See also  Power bi show value as percentage + 13 Examples

When the user selects multiple items from the combo box control, the Power Apps gallery will filter. To work with this scenario, we are going to use the above example of the Power Apps gallery and the following steps are:

  • First, we need to set the toggle On on the combo box’s Allow Multiple selections.
  • Then insert the below expression on the Items property of the gallery.
Items = ilter( BikeSales, Or(IsBlank(Cmb_PaymentMode.SelectedItems), IsEmpty(Cmb_PaymentMode.SelectedItems),'Payment Mode'.Value = Index(Cmb_PaymentMode.SelectedItems,1).Value,'Payment Mode'.Value = Index(Cmb_PaymentMode.SelectedItems,2).Value,'Payment Mode'.Value = Index(Cmb_PaymentMode.SelectedItems,3).Value))

Note: As there are 3 choices in the combo box, we have used 1,2,3 for each choice on the above expression.

PowerApps filter combo box selected items
PowerApps filter combo box selected items

Let’s save and preview the app and select multiple items from the combo box control (ex-Instant Payment, Advance Payment). We can see the gallery will display only the filtered items based on combo box selected items.

Power Apps filter gallery multiselect combo box
Power Apps filter gallery multi-select combo box

This is how to filter a Power Apps gallery based on the combo box multi-selected items.

Power Apps filter gallery multiple combo boxes

Here, we will see how to filter a Power Apps gallery based on multiple combo box items. Users can filter the Power Apps gallery by selecting choices from the multiple combo box controls.

To implement this need, we are going to use the above Power Apps gallery that contains the data from a certain SharePoint list (i.e., Bike Sales).

On that Power Apps screen, we have added 2 combo box control to display the items of the payment mode and the unique values of the title field. For this, insert the below expressions on both the combo box’s Items properties respectively.

Items = Choices(BikeSales.'Payment Mode')           // Display the items from the choice field (i.e., Payment Mode)

Items = Distinct(BikeSales, Title)                             // Display the unique values from the Title field
Filtering a Gallery with multiple Power Apps combo box
Filtering a Gallery with multiple Power Apps combo box

To filter the above Power Apps gallery based on multiple combo box selections, insert the below expression on the gallery’s Items property.

Items = Filter(BikeSales ,(Cmb_PaymentMode.Selected.Value in 'Payment Mode'.Value && Cmb_Vehicle.Selected.Result in Title))

Where Cmb_PaymentMode and Cmb_Vehicle are the names of the combo box controls. As per the above expression, the filtered data will be displayed only if both selections are satisfied.

Note: You can use ||(Or) instead of && (And).

Filter gallery by multiple combo box selections Power Apps
Filter gallery by multiple combo box selections Power Apps

Let’s preview the app and select values from both combo boxes. (ex: Instant Payment, Thunder 360). We can see it will display only the filtered data that satisfied both the items from the combo box controls.

PowerApps gallery with multiple combo box filters
PowerApps gallery with multiple combo box filters

This is how to filter a Power Apps gallery with multiple combo box selections.

Read How to Reset Power Apps Combo Box

Power Apps Combobox distinct filter

Here, we will see how to do a distinct filter using Power Apps combo box control. When the users select any choices from the combo box control, the filtered data will display in the Power Apps gallery without repeating the duplicate values.

If this is the case, the following steps are:

  • We have prepared a SharePoint list having Job titles and Locations (choices) like the below:
powerapps combobox distinct filter
powerapps Combo box distinct filter
  • Using the above SharePoint list, we will create a Power Apps gallery with only the title field shown below, as well as a combo box control to display the job location’s choices using the below expression on the Items property.
Items = Choices('Job Openings'.JobLocation)

Where,

  1. Job Openings: The name of the SharePoint list.
  2. JobLocations: The name of the SharePoint choice column.
powerapps combobox based on distinct filter
Power Apps combo box based on distinct filter
  • Insert the below expression on the gallery’s Items property to filter and display the distinct values based on the combo box’s choice.
Items = Distinct(Filter('Job Openings',JobLocation.Value = Cmb_JobLocation.Selected.Value),Title)

Where,

  1. Cmb_JobLocation: The name of the combo box control
  2. Title: The SharePoint column name which will be distinct.
distinct filter using powerapps combobox
distinct filter using powerapps Combo box

Let’s play the app in preview mode and select any item from the combo box control. As we can see, it will display only the distinct or unique values within the Power Apps combo box control. (Ex- Chicago)

powerapps combobox filter and distinct values
powerapps combo box filter and distinct values

This is how to display the filtered distinct values based on the Power Apps combo box control.

See also  Power bi show value as percentage + 13 Examples

Read Power Apps combo box with Office 365 users

Power Apps filter combo box empty value or blank

Here, we will see how to display empty values or blank fields based on the Power Apps combo box selection. Suppose, we have a SharePoint data source having some empty fields in a certain column.

powerapps filter combobox empty value
powerapps filter combo box empty value

In this section, we will see how to include those empty values as a filter option based on combo box selection. For this, the following steps are:

  • On the Power Apps screen, build a gallery using the above SharePoint list. Also, add a combo box control and insert the below expression to display the unique value of the title column.
Items = Distinct('Job Openings',Title)
  • To filter and display the empty values, insert the below query within the gallery’s Items property.
Items = Filter('Job Openings',IsBlank(JobLocation_Cmb.Selected.Result)|| Title = JobLocation_Cmb.Selected.Result)

Where,

  1. Job Openings: The name of the data source (SharePoint)
  2. JobLocation_Cmb: The name of the combo box control
  3. Title: The SharePoint column name
powerapps filter combobox blank
powerapps filter combo box blank

Let’s save the app and preview it. Select any item from the combo box control. (Ex- M365 Developer). We can see, it will appear with the empty values like below:

powerapps filter combobox with blank
powerapps filter combo box with blank

This is how to filter and work with blank values based on the Power Apps combo box control.

Power Apps combo box filter collection

Here, we will see how to filter a collection based on Power Apps combo box selection(s). To implement this, the following steps are:

  • On the Power Apps screen, let’s build a collection. For this, insert the below expression on the screen’s OnVisible property.
OnVisible = ClearCollect(ColEmployee, {Name: "Harry", Contact: 4569870, Department: "IT"},{Name: "Krish", Contact: 4500236, Department: "Finance"},{Name: "John", Contact: 7890053, Department: "Marketing"},{Name: "Albert", Contact: 1593562, Department: "IT"},{Name: "Lily", Contact: 6356258, Department: "HR"},{Name: "Scott", Contact: 7201456, Department: "IT"},{Name: "Sonam", Contact: 5863256, Department: "Finance"})

Where,

  1. ColEmployee: The name of the collection.
  2. Name, Contact, Department: The name of the collection headers.

We can find the collection, once the screen is visible:

Power Apps combo box filter collection
Power Apps combo box filter collection
  • Let’s add a gallery control to the Power Apps screen to display the collections like the below:
combo box filter Power Apps collection
combo box filter Power Apps collection
  • Next, add a combo box control to the screen and insert the below expression on the Items property to display only the unique values of the Department.
Items = Distinct(ColEmployee, Department)
Power Apps filter collection using combo box
Power Apps filter collection using combo box
  • To filter this collection data based on the combo box selection(s), insert the below expression on the gallery’s Items property.
Items = Filter(ColEmployee, Or(IsBlank(Cmb_Department.SelectedItems),IsEmpty(Cmb_Department.SelectedItems), Department in Cmb_Department.SelectedItems))

Where Cmb_Department is the name of the combo box control.

Power Apps combo box filter on collection
Power Apps combo box filter on collection

Let’s select item(s) from the combo box control(Ex- IT, Finance)and we can see the filtered collection items will display within the Power Apps gallery.

How to Filter a collection using a Combo Box
How to Filter a collection using a Combo Box

This is how to filter a collection using a Power Apps combo box.

See also  Power Apps collection filter [With real examples]

Read How to Sort Combo Box Items in Power Apps

Power Apps filter data table with Combo box

In this section, we’ll look at how to filter a data table based on the item(s) selected in a combo box. That is, when the user selects an item(s) from the Power Apps combo box control, the data table will filter based on the item(s) selected.

To work with this scenario, the following steps are:

  • Suppose, we have prepared a Power Apps data table using a certain SharePoint list like below:
powerapps filter datatable with combobox
powerapps filter data table with combo box
  • Add a combo box control to the screen and insert the below expression on the Items property to display the choices of the Location column.
Items = Choices(Events.Location)
Filter Datatable based on Power Apps Combo box
Filter Data table based on Power Apps Combo box
  • To filter the data table, insert the below expression on the data table’s Items property.
Items = If(
    IsBlank(Cmb_Location.Selected),
    Events,
    Filter(
        Events,
        Location in Cmb_Location.SelectedItems
    )
)

Where,

  1. Cmb_Location: The name of the combo box control.
  2. Location: The name of the column that will be filtered.
Power Apps Data Table Filter with Combo Box
Power Apps Data Table Filter with Combo Box

Let’s preview the app and select a single value or multiple values from the combo box control (ex-Chicago, Phonix). We can see the data table will only display those datasets whose location is Chicago or Phonix, like below:

Filtering a Data Table Based on Selections from ComboBox
Filtering a Data Table Based on Selections from ComboBox

This is how to filter a data table based on selections from the Power Apps Combo Box control.

Read How to Patch Power Apps Combo Box

Power Apps Combobox filter office 365 users

Do you want to filter Office 365 Users based on a Power Apps combo box control?

Recently, we published an article where we discussed how to filter a Power apps combo box control using Office 365 Users. We recommend you follow that mentioned blog to get the answer.

Conclusion

From the above Power Apps tutorial, we learned how to filter using the Power Apps combo box control. Also, we have discussed below topics such as:

  • powerapps Combo box filter gallery
  • powerapps filter combo box selected items
  • powerapps combo box filter office 365 users
  • powerapps filter data table with a combo box
  • Power Apps filter gallery multiple combo boxes
  • Power Apps combo box filter collection
  • powerapps combo box distinct filter
  • powerapps filter combo box empty value

You may like the following Power Apps tutorials:

>