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.
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.
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.
- 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,
- Workers is the name of the SharePoint list.
- WorkMode.Value is the name of the Choice field.
- “Hybrid” defines the choice field value.
Once the formula is applied, the data will be filtered as per the choice value.
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’.
To meet this requirement, the following steps are:
- On the above Power Apps Data table, insert the below expression on the Items property.
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.
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.
This is how to filter a SharePoint choice column using the OR operator within the Power Apps.
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:
- How to use PowerApps search() function SharePoint list?
- Create a Power Apps dialog box or Popup message box
- How to get current date in Power Apps?
- How to do group by and calculate sum in Power Apps?
- How to display images within Power Apps from a SharePoint list?
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Out audiences are from the United States, Canada, United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a SharePoint MVP(8 times), check out My MVP Profile. I have also worked in companies like HP, TCS, KPIT, etc.