How to filter SharePoint choice field within Power Apps?

This Power Apps tutorial will discuss filtering the SharePoint choice field within the Power Apps.

Recently, we got a requirement to filter the SharePoint choice field while working with the Power Apps canvas apps.

Additionally, we will discuss how to do filter in the Power Apps based on the SharePoint choice column using AND & OR operators.

Like, we have created a SharePoint list having choice columns along with different types of columns. We want to filter the data using the SharePoint choice column(s) within the Power Apps.

To meet this requirement, the following steps are taken:

PowerApps filter SharePoint list choice field

Let us understand how to filter data in Power Apps based on the SharePoint list choice field.

Requirements:

We have a SharePoint list named Workers having two choice columns WorkMode ad Position along with a People column and a date column.

PowerApps filter SharePoint list choice field
PowerApps filter SharePoint list choice field

As per the requirement, we will filter the below data based on the SharePoint choice field. When the user selects WorkMode as Hybrid, it will display only those data whose WorkMode is equal to Hybrid. This whole process will go on the Power Apps Canvas Apps.

Filtering SharePoint choice field in PowerApps
Filtering SharePoint choice field in PowerApps

To get the filtered data, the following steps are:

  • On the Power Apps, build a blank canvas app. For this, go to Create > Blank app > Blank canvas app > Create.
  • It will create a blank canvas app with a blank screen. Now, connect the SharePoint list to the canvas app. Navigate to Add Data > SharePoint > Choose list > Connect.
  • Add a Power Apps Data table to the screen and connect it with the respective SharePoint list (Workers). All of the fields have been retrieved and displayed in the data table.
Filtering SharePoint choice column with Power Apps
Filtering SharePoint choice column with Power Apps
  • To display the data based on the SharePoint choice field value (i.e., whose WorkMode is Hybrid), insert the below expression on the Data table’s Items property.
Items = Filter(Workers, WorkMode.Value = "Hybrid")

Where,

  1. Workers is the name of the SharePoint list.
  2. WorkMode.Value is the name of the Choice field.
  3. “Hybrid” defines the choice field value.
See also  Power BI Pie Chart Conditional Formatting

Once the formula is applied, the data will be filtered as per the choice value.

Power Apps filter data based on SharePoint choice field
Power Apps filter data based on the SharePoint choice field

This is how to filter data based on the SharePoint choice column within the Power Apps.

PowerApps filter SharePoint list choice field with And feature

In this section, we’ll look at how to use the And feature in Power Apps to filter a SharePoint list’s data based on a choice field value.

Requirements:

The above Power Apps data table will only display those data whose WorkMode is ‘WFO’ and Position is ‘Deliver Head’.

Power Apps filter SharePoint choice field using AND
Power Apps filter SharePoint choice field using AND

To meet this requirement, the following steps are:

Items = Filter(Workers, WorkMode.Value = "WFO" And Position.Value = "Deliver Head")

Where Position.Value is the name of another choice field and “Deliver Head” is the value of that SharePoint choice field.

Filtering SharePoint choice column with And in Power Apps
Filtering SharePoint choice column with And in Power Apps

This is how to filter a SharePoint choice column with And in Power Apps.

PowerApps filter SharePoint list choice field with Or feature

Similarly, we’ll see how to use the ‘Or’ feature in Power Apps to filter a SharePoint list’s data based on a choice field value.

That is, the above Power Apps data table will display only those data whose Workmode is equal to WFH or Position is equal to Developer.

To get the filter data based on the SharePoint choice field, the following steps are:

  • Insert the below expression on the above Power Apps data table’s Items property.
Items = Filter(Workers, WorkMode.Value = "WFH" Or Position.Value = "Developer")
  • Once the formula is applied, the data table will display the filtered data that matches the expression.
Power Apps filter SharePoint choice column with OR
Power Apps filter SharePoint choice column with OR

This is how to filter a SharePoint choice column using the OR operator within the Power Apps.

See also  Power BI Slicer Buttons

Conclusion

This Power Apps tutorial taught us how to filter within the Power Apps based on different scenarios. Such as:

  • PowerApps filter SharePoint list choice field
  • PowerApps filter SharePoint list choice field with And feature
  • PowerApps filter SharePoint list choice field with Or feature

You may like the following Power Apps tutorials:

>