How to Filter Power Apps Collection?[Text/Number/Choice/Date/Person]

A few days back, I worked with a Power Apps requirement where I needed to filter a collection based on some criteria like according to current date, current user, year, and some sharepoint list columns like Text, Choice, Person, Yes/no, etc.

In this Power Apps tutorial, I will explain how to filter Power Apps collection with various examples like:

  • Power Apps collection filter SharePoint list
  • Power Apps collection filter contains
  • Power Apps collection filter with OR
  • Power Apps collection filter with AND
  • Power Apps collection filter by date
  • Power Apps collection filter and sort
  • Power Apps collection filter by user
  • Power Apps collection filter by current user
  • Power Apps collection filter by dropdown
  • Power Apps filter collection by another collection
  • Power Apps collection filter year
  • PowerApps filter not in collection
  • Power Apps collection filter multiple condition
  • Filter Power Apps Collection With Search Text Input
  • Power Apps filter collection by Number
  • Filter Power Apps collection by Choice Column
  • Filter Power Apps collection by Person Column
  • Filter Power Apps collection by Yes/no Column

Filter Power Apps Collection Using a SharePoint List

First, we will see how to filter a Power Apps collection based on a SharePoint list.

The screenshot below represents a SharePoint list [Product Model] containing various columns like:

ColumnData type
TitleSingle line of text
ProductSingle line of text
Purchase DateDate and time
Ordered ByPerson
ManufacturerChoice
Power Apps collection filter SharePoint list
Power Apps collection filter SharePoint list

Let’s use the above SharePoint list to create a Power Apps collection and then filter the collection to display only data whose “Product type is Laptop.” To achieve this requirement, the following steps are necessary:

  • Insert a button control into the Power Apps screen and set the Text to Collect Filter Data.
  • Add the expression mentioned to the button’s OnSelect property:
OnSelect = ClearCollect(ProductColl, Filter('Product Model', Product = "Laptop"))

Where,

  • ProductColl is the name of the existing collection that we have created.
  • ‘Product Model’ is the name of the SharePoint data source list.
  • Product is the name of the
Power Apps collection filter SharePoint
Power Apps collection filter SharePoint

When we click the button, we see that the filtered collected data will be created within the collection.

Add a data table control to the screen to display the collected data. Connect it with the collection, i.e., ProductColl, and add the fields.

Filter a PowerApps collection from SharePoint
Filter a PowerApps collection from SharePoint

This is how to filter a PowerApps collection from the SharePoint list.

Power Apps collection filter contains

In this section, we will see how to build a Power Apps collection that filters items based on whether they contain a specific word or text.

The Power Apps covers a range of built-in functions and operators. Unfortunately, developers and consultants with relevant programming experience are familiar with some functions missing from Canvas apps. One such function is Contains().

However, the in and exactin operators serve the same purpose as contains(). Suppose, using the above SharePoint list, we are going to create a filtered collection that will store only those data whose Title contains the specific text (Ex-Apple)

To achieve this need, the following steps are:

  • Insert the below expression on the button’s OnSelect property.
OnSelect = ClearCollect(ProductColl, Filter('Product Model', "Apple" in Title))

ProductColl is the name of the existing collection we created to store the data from the SharePoint list. “Product Model” is the name of the SharePoint list, and “Title” is the name of the SharePoint column.

PowerApps collection filter contains
PowerApps collection filter contains

Let’s click on the button while clicking on the Alt key. Then, add a data table and connect it to the ProductColl collection. Also, add the fields to display the collected and filtered data as shown below:

Filter Power Apps collection with contains
Filter Power Apps collection contains

This is how to filter a Power Apps collection that contains a specific text.

Power Apps collection filter with OR

In this section, we’ll look at how to use the OR operator to work with the Power Apps collection filter. That is, we will create a Power Apps collection that will display data by filtering the SharePoint list with the Product value of the Laptop or Mouse.

To work with this requirement, we are going to use the above SharePoint list i.e., Product Model, and the following steps are:

  • Add a button control on the Power Apps screen and give the Text to the button as needed. (Ex- Mouse OR Laptop)
  • Insert the below expression on the button’s OnSelect property. So that the collection will be created once the button is clicked.
OnSelect = ClearCollect(ProductColl, Filter('Product Model', Product = "Laptop" || Product = "Mouse"  )) 

Where ProductColl is the name of the existing collection, ‘Product Model’ is the name of the SharePoint list, Product is the column name, and “Laptop” and “Mouse” are the column values based on which the collection will filter.

Power Apps collection filter with OR
Power Apps collection filter with OR

Let’s press the button control to create the filtered collection. To display the collected data, add a data table control to the Power Apps screen.

Connect the data table to the collection, i.e., ProductColl, and add the fields to it.

PowerApps collection filter with OR
PowerApps collection filter with OR

This is how to filter a Power Apps collection with OR operator.

Power Apps collection filter with AND

Similarly, this section will see how to use the AND operator to filter a Power Apps collection. For this, we will use the above SharePoint list and the collection we have created, i.e., ProductColl.

Assume we will create a collection that will only display data with the word “Apple” in the product title and the product value is equal to Mobile.

For this, the following steps are:

  • Add a button control to the Power Apps screen.
  • Insert the below expression on the button’s OnSelect property.
OnSelect = ClearCollect(ProductColl, Filter('Product Model', Product = "Mobile" && "Apple" in Title  ))
  • Next, a data table control will be added to display the collected data. Connect it with the ProductColl collection and add the respective fields to the data table.
  • Once the button is clicked, we can see the corresponding filtered data displayed on the data table.
Power Apps collection filter with AND
Power Apps collection filter with AND

The above data table will display only one data entry as it satisfies the filter condition. This is how to filter a Power Apps collection with the AND operator.

Power Apps collection filter by date

Do you ever filter a Power Apps collection by date? If not, follow this example to show how to filter a Power Apps collection based on date.

We will use the collection as mentioned above to filter the data based on date value. That means the collection will display only those records whose Purchase date is smaller than a specific date. (Ex- 11/10/2022). The following steps must be taken to accomplish this:

  • Add a button control to the Power Apps screen.
  • Insert the below expression on the button’s OnSelect property.
OnSelect = ClearCollect(ProductColl, Filter('Product Model', 'Purchase Date' < Date(2022,11,10) ))

Where ‘Purchase Date’ is the name of the date column of the SharePoint data source.

Power Apps collection filter by date
Power Apps collection filter by date
  • Add a data table control to the screen and connect it to the collection, i.e., ProductColl. Once the button is clicked, the filtered data will display on the data table as shown below:
PowerApps collection filter by date
PowerApps collection filter by date

The above data table only displays records whose purchase date falls before 10/11/2022 (mm/dd/yyyy). This is how to filter a Power Apps collection by date.

Power Apps Filter Collection by Date Range

As in the image below, I have two Date picker controls:

  1. Loan Start Date
  2. Loan End Date

When the user selects a particular date from both the controls, the gallery will filter and display the specific records that fall between those selected dates of the date pickers.

Power Apps filter collection by date range

Let me show you how to achieve this:

  • On the Power Apps screen, insert two Date-Picker controls as shown below:
How to filter Power Apps collection by date range
  • Insert a Gallery control and set its Items property to:
Sort(
    If(
        IsBlank(dte_LoanApproval_EndDate.SelectedDate),
        If(
            IsBlank(dte_LoanApproval_StartDate),
            colLoanApproval,
            Filter(
                colLoanApproval,
                'Loan Start Date' >= dte_LoanApproval_StartDate.SelectedDate
            )
        ),
        If(
            IsBlank(dte_LoanApproval_StartDate),
            Filter(
                colLoanApproval,
                'Loan Start Date' <= dte_LoanApproval_EndDate.SelectedDate
            ),
            Filter(
                colLoanApproval,
                'Loan Start Date' <= dte_LoanApproval_EndDate.SelectedDate,
                'Loan Start Date' >= dte_LoanApproval_StartDate.SelectedDate
            )
        )
    ),
    'Loan Start Date',SortOrder.Descending
   )        

Where,

  1. dte_LoanApproval_EndDate = Power Apps 2nd date picker control name
  2. dte_LoanApproval_StartDate = Power Apps 1st date picker control name
  3. colLoanApproval = Collection name
  4. Loan Start Date = SharePoint list date column name
Filter Power Apps collection by date range

This is how we can filter the Power Apps collection by date range.

Power Apps Filter Collection By Today’s Date

I will show you how to filter the Power Apps collection by today or the current date.

Example:

Whenever the user clicks the arrow icon, the gallery filters and displays the records that started today using the SharePoint list date column [“Loan Start Date“] as shown below:

Power Apps Filter Collection Today By Date Column

Let me show you how to achieve this:

  • On the Power Apps screen, insert a Next arrow icon -> Set its OnSelect property to:
ClearCollect(
    colToday,
    Filter(
        'Loan Approval',
        'Loan Start Date' >= Today(),
        'Loan Start Date' < DateAdd(
            Today(),
            1,
            TimeUnit.Days
        )
    )
)

Where,

  1. colToday = Provide the Collection name
  2. Loan Approval = SharePoint list name
  3. Loan Start Date = SharePoint list date column name
How to filter Power Apps collection today by date column
  • Insert a Gallery control and set its Items property to:
ColToday

Where,

  1. colToday = Collection name
Filter Power Apps collection today by date column

Power Apps collection filter and sort

Here, we will see how to sort filtered data within the Power Apps collection. Let’s take the above collection, where we will sort the purchase date in descending order.

To implement this need, the following steps are:

  • Add a button control to the screen.
  • Set the Text property (Ex- Filter and Sort By Date).
  • Insert the below expression on the button’s OnSelect property.
OnSelect = ClearCollect(ProductColl, Sort(Filter('Product Model', 'Purchase Date' < Date(2022,11,10) ),'Purchase Date',Descending))
Power Apps collection filter and sort
Power Apps collection filter and sort

To display the filtered data in sorted order, add a data table control to the Power Apps screen. Connect the data table with the collection, i.e., ProductColl, and add the fields to the data table.

Next, click on the button while clicking on the Alt key.

PowerApps collection filter and sort
PowerApps collection filter and sort

This is how to filter and sort within the Power Apps collection.

Power Apps collection filter by user or current user

Let’s see how the current user can filter a Power Apps collection. That means the collection will be filtered and displayed based on the current user.

There is a people column within the Power Apps collection (i.e., ProductColl) created from the previously mentioned SharePoint list. We will use that collection to filter the data only to display where the people column, i.e., ‘OrderBy,’ equals the current user.

For this, the following steps are:

  • On the Power Apps screen, add a button control.
  • Give a text to the button.
  • Insert the below expression on the button’s OnSelect property.
OnSelect = ClearCollect(ProductColl, Filter('Product Model','Ordered By'.Email = User().Email))
Power Apps collection filter by user
Power Apps collection filter by user
  • Add a data table and connect that table with the collection i.e., ProductColl. Add the fields to display the filtered data.
Power Apps collection filter by current user
Power Apps collection filter by the current user

Because the current user is “Sonam Subhadarsini,” it is only displaying data relevant to that user.

This is how to filter a Power Apps collection by the current user.

Power Apps collection filter by dropdown

This section will see how to filter a Power Apps collection by dropdown. The Power Apps collection will be filtered based on the dropdown selection.

Assume we will use the above collection to create a dropdown control that displays all of the tenants’ users. The Power Apps collection will be filtered based on the dropdown selection. To work with the scenarios, the following steps are:

  • Connect the canvas app with the Office356Users.
  • Add a dropdown control, to the Power Apps screen.
  • Insert the below expression on the dropdown’s Items property to display all the users.
Items = Office365Users.SearchUser()
  • Next, add a button control to the Power Apps screen.
  • Insert the below expression into the button’s OnSelect property.
OnSelect = ClearCollect(ProductColl, Filter('Product Model','Ordered By'.DisplayName = Users_dropdown.Selected.DisplayName))

Where Users_dropdown is the dropdown control’s name.

Power Apps collection filter by dropdown
Power Apps collection filter by dropdown

Next, connect a data table control with the collection, i.e., ProductColl. Also, add the fields to the data table.

Select a user’s name from the dropdown control and click on the button. We can see the filtered data will be visible on the Power Apps data table as shown below: (Ex- Sonam Subhadarsini)

PowerApps collection filter by dropdown
PowerApps collection filter by dropdown

This is how to filter a Power Apps collection via a drop-down control.

Power Apps filter collection by another collection

In this section, we’ll look at how to use Power Apps to filter a collection by another collection. Assume we have two collections and want to make another collection out of them. This new collection will only show items that are shared by both collections.

For this, the following steps are:

  • On the Power Apps screen, we have created two collections, CollProduct1 and CollProduct2, on the buttons’ OnSelect property.
OnSelect = ClearCollect(CollProduct1, {Product1:"Laptop"},{Product1:"Mouse"},{Product1:"Desktop"},{Product1:"Office Chair"},{Product1:"Keyboard"})   // Button1

OnSelect = ClearCollect(CollProduct2, {Product2:"Laptop"},{Product2:"Desktop"},{Product2:"Coffee Mug"},{Product2:"Mouse"})     //Button2
Power Apps filter collection by another collection
Power Apps filter collection by another collection
  • On the above screen, we have added 2 data tables and connected them to the collections respectively to display the collected data.
  • Add another button control to the Power Apps screen and insert the expression below into the button’s OnSelect property.
OnSelect = ClearCollect(CollFinal,Filter(CollProduct1,Product1 in CollProduct2.Product2).Product1)

CollFinal is the new collection’s name to store the filtered data.

PowerApps filter collection by another collection
PowerApps filter collection by another collection

Add a data table and connect that control with the CollFinal collection. Also, add the field to display the collected filter data.

Filter PowerApps collection by another collection
Filter PowerApps collection with another collection

This is how to use another collection to filter the PowerApps collection.

Power Apps collection filter year

This section will see how to filter a Power Apps collection by year. Suppose we have a SharePoint list named Workers that has a people column and a date column. We will create a collection using that SharePoint list, and we will also build a dropdown that will display the list of years.

When the user selects any year from the dropdown control, the collection will filter based on the selected value. To work with the scenarios, the following steps are:

  • On the Power Apps screen, add a button control.
  • Give a name to the button control (Text: Create Collection)
  • Insert the below expression to create the collection.
OnSelect = Collect(Colworkers, Workers)

Where Colworkers is the name of the new collection and Workers is the name of the SharePoint data source.

Power Apps collection filter year
Power Apps collection filter year
  • Add a dropdown control to the Power Apps screen and insert the Items such as:
Items = [2018, 2019, 2020, 2021, 2022]
  • Add another button control to the screen and insert the below expression on the button’s OnSelect property.
OnSelect = ClearCollect(Colworkers, Filter(Workers, Year(JoinDate) = Year_Dropdown.Selected.Value))

where Colworkers is the name of the existing collection, JoinDate is the name of the date column, and Year_Dropdown is the name of the dropdown control name.

PowerApps collection filter year
PowerApps collection filter year

Next, add a data table control and connect it with the Colworkers collection, and add the fields to display the filter data.

First, click on the Create Collection button, then select a year from the dropdown control(ex: 2020), and finally click on the Filtered Data button to show the data on the Power Apps data table as shown below:

PowerApps collection filter by year
PowerApps collection filter by year

This is how to filter a Power Apps collection by year.

Power Apps Filter Collection By Current Year

Next, we will discuss how to filter the Power Apps collection by the current year.

When the user clicks on the Check button, the Data table filters and displays the records that started this year and ended this year using the SharePoint list date columns [“Loan Start Date” and “Loan End Date“].

Power Apps Filter collection by a current year

Follow the below steps to achieve this:

  • On the Power Apps screen, insert a Button control -> Set its OnSelect property to:
ClearCollect(colYear,
With(
    {
        StartDate: Date(
            Year(Today())-4,
            Month(Today()),
            Day(Today())
        )+ 1,
        EndDate: Date(
            Year(Today()),
            Month(Today()),
            Day(Today())
        )
    },
    Filter(
        'Loan Approval',
        'Loan Start Date' >= StartDate,
        'Loan End Date' <= EndDate
    )
)
)

Where,

  1. colYear = Provide the Collection name
  2. Loan Approval = SharePoint list name
  3. Loan Start Date = SharePoint list date column name
  4. Loan End Date = SharePoint list date column name
DAX date function in Power BI
  • On the Power Apps screen, insert a Data Table -> Set its Items property to:
colYear

Where,

  1. colYear = Collection Name
DAX Date function in Power BI
  • Save, Publish, and Preview the app. Whenever the user clicks the button control, the gallery filters and displays the records that started in the current year and ended in the current year using the SharePoint list date columns.
DAX DATE- Hour function example on Power BI

This way, we can filter the Power Apps collection by current year.

Power Apps filter not in collection

In this section, we’ll look at how to use the Power Apps filter, not in the collection. That is, we will extract the items that are not in the other collection from two collections.

Suppose, we have created two collections (i.e., CollTimeSlot and CollBookedSlot.) by inserting the below expressions on the buttons’ OnSelect properties.

  • Insert the below expression in the first button’s OnSelect property:
OnSelect = ClearCollect(CollTimeSlot, {Time:"10:00 AM"}, {Time:"10:30 AM"}, {Time:"11:10 AM"}, {Time:"11:35 AM"}, {Time:"13:15 PM"},{Time:"13:40 PM"}, {Time:"15:20 PM"})  

Where CollTimeSlot is the name of the new collection and Time is the name of the collection header.

  • Similarly, insert the below expression on the second button’s OnSelect property.
OnSelect = ClearCollect(CollBookedSlot, {Slot:"15:20 PM"}, {Slot:"10:30 AM"},{Slot:"11:35 AM"})

Where CollBookedSlot is the name of the new collection and Slot is the name of the collection header.

  • Add two galleries to the Power Apps screen to display the respective collections data.
powerapps filter not in collection
PowerApps filter not in collection
  • Add a button control to the Power Apps screen and insert the below formula on the button’s OnSelect property to collect the filter data.
OnSelect = ClearCollect(CollRestSlot, Filter(CollTimeSlot, !(Time in CollBookedSlot.Slot)))

where CollRestSlot is the name of the new collection to store the filtered data.

  • Add a gallery control to the screen and connect that control with the collection i.e., CollRestSlot.
  • Once the button is clicked, we can see the rest time slots will be visible on the Power Apps gallery.
Power Apps filter not in collection
Power Apps filter not in collection

This is how to filter a Power Apps collection if that is not in another collection.

Power Apps collection filter multiple conditions

In this example, we will see how to filter a Power Apps collection using multiple conditions. That means we will filter a Power Apps collection based on multiple criteria.

Let’s take the above example of the SharePoint list(i.e., Product Model) and build a collection using that SharePoint data source. Then we will filter that collection based on multiple conditions such as the collection will display only those data whose product value is equal to Laptop or Mouse, and the purchase date should be less than 10th November 2022.

For this, the following steps are:

  • On the Power Apps screen, add a button control and insert the below expression on the OnSelect property to build the collection.
OnSelect = Collect(ProductModelCol, 'Product Model')

Where ProductModelCol is the name of the new collection to store the SharePoint data. Once the button is clicked the data will be stored in the collection.

  • Again add another button control and insert the below expression on the OnSelect property to store the filtered data with multiple conditions.
OnSelect = ClearCollect(ProductModelCol, Filter('Product Model', Product = "Mouse" Or Product = "Laptop"  And  'Purchase Date' < Date(2022,11,10)))
Power Apps collection filter multiple condition
Power Apps collection filter multiple conditions
  • Add a data table control to the Power Apps screen and connect it with the collection i.e., ProductModelCol.
PowerApps collection filter multiple condition
PowerApps collection filter multiple condition

This is how to filter a Power Apps collection using multiple conditions.

Filter Power Apps Collection With Search Text Input

Here, we will filter the Power Apps collection with multiple search text inputs.

I have a SharePoint list as Loan Approval with columns below:

Column NameData Type
NameTitle
Loan TypeChoice [“Car Loan“, “Gold Loan“, “Home Loan“]
Credit ScoreNumber
Salary Currency
Loan Applied DateDate and time
Approved or NotYes/no
ID ProofImage
Loan Handled byPerson/group
create shared calendar outlook

There is a Search box and a Data table control. When a user searches for any name, loan type, Salary, etc., in the search box, the data table filters and displays the result based on the search box value.

Power Apps filter collection With Search Text Input
  • On the Power Apps Screen, insert the Text input control and Search icon as shown below:
Power Apps Collection filter with search Text Input
  • Set the Text input Padding-Left to 50 pixels.
Create a new group in office 365
  • Write the code below on the Data table’s Items property as:
Filter(
    colApproval,
    StartsWith(
        Title,
        txt_Search.Text
    ) || StartsWith(
        'Loan Type'.Value,
        txt_Search
    ) || StartsWith(
        Salary,
        txt_Search.Text
    ) || StartsWith(
        'Loan Applied Date',
        txt_Search.Text
    ) || StartsWith(
        'Approved or Not',
        txt_Search.Text
    )
)

Where,

  1. colApproval – Collection name
  2. StartsWith – The function checks whether one text string begins with another
  3. Title – SharePoint list Column Name
  4. txt_Search – Text input control name
Create a new group in office 365

Power Apps Filter Collection By Single Search Text Input

The gallery filters and shows all the records according to user search input when a user searches or begins with any letter of any user.

Power Apps Filter Collection By Name with one text-input control
  • Apply the code below on Gallery’s Items property:
Filter(
    colApproval,
    StartsWith(
        Title,
        txt_UserName.Text
    )
)

Where,

  1. colApproval = Collection name
  2. Title = SharePoint list column name
  3. txt_UserName = Text-input control name
Power Apps Filter Collection Starts With

Power Apps Filter Collection By Number

When a user searches or starts with any first digit of Credit Score [Number column] and clicks the Search button, the gallery filters and displays all the records based on user search input.

Power Apps filter collection by number column using text-input starts with
  • Insert a Power Apps Text input as shown below:
Filter Power Apps collection by number column using text-input starts with
  • Add a Button control [Search] and set its OnSelect property to:
ClearCollect(
    colCreditScore,
    Filter(
        'Loan Approval',
        StartsWith(
            'Credit Score',
            txt_CreditScoree
        )
    )
)

Where,

  1. colCreditScore = Provide the collection name
  2. Loan Approval = SharePoint list name
  3. Credit Score = SharePoint list number column name
  4. txt_CreditScoree = Text-input control name
How to filter Power Apps collection by number column using text-input starts with
  • Set its Items property of the Gallery control as:
colCreditScore 

Where,

  1. colCreditScore = Collection name
Filter a Power Apps collection Starts With

This way, we can filter the Power Apps collection by number.

Filter Power Apps Collection By Choice Column

I will show you how to filter the Power Apps collection by choice column.

Example – 1:

When a user selects a Loan type [SharePoint Choice column] from the drop-down control and clicks the Search icon, the gallery will filter and display the relevant records based on the selected drop-down value.

How to Filter Power Apps Collection By Choice Column
  • Insert a Drop-down control and set its Items property to:
Choices('Loan Approval'.'Loan Type')

Where,

  1. Loan Approval: SharePoint list name
  2. Loan Type: SharePoint list choice column name
How to filter Power Apps collection by drop-down control from SharePoint list
  • Add a Search icon and set its OnSelect property as:
ClearCollect(
    coldrp,
    Filter(
        'Loan Approval',
        'Loan Type'.Value = drp_LoanType.Selected.Value
    )
)

Where,

  1. coldrp: Collection name
  2. drp_LoanType: Dropdown control name
Power Apps Filter collection by drop-down control SharePoint list
  • Insert a Gallery control and set its Items property:
coldrp
How to filter Power Apps collection by choice column SharePoint list

Example – 2:

Here, there is a Power Apps Data table control. This data table contains the SharePoint choice values [Loan Type]. It filters and displays the user choice value once the user opens the app.

Power Apps filter collection by choice column
  • Create a Power Apps collection on Screen’s OnVisible property:
ClearCollect(colFilter,'Loan Approval')

Where,

  1. colFilter = Collection name
  2. Loan Approval = SharePoint list name
Filter Power Apps collection by choice column value
  • Use the code below on the Power Apps Data table’s Items property:
Filter(
    colFilter,
    'Loan Type'.Value = "Gold Loan"
)

Where,

  1. Gold Loan = SharePoint list choice column value
How to filter Power Apps collection by choice column value

Power Apps Filter Collection Using Choice Column With AND Operator

Next, I will show you how to filter the Power Apps collection using the choice column value with the AND operator.

We will filter the data table from that collection and display the “Home Loan” records with credit scores over 700.

Filter Power Apps collection by choice column
  • Set the Data table’s Items property to the code below:
Filter(
    colFilter,
    'Loan Type'.Value = "Gold Loan" And 'Credit Score' > 700
)

Where,

  1. colFilter = Collection name
  2. Loan Type = SharePoint list choice column name
  3. Gold Loan = SharePoint list choice column value
  4. Credit Score = SharePoint list number column name
Power Apps filter collection using choice column value with AND feature

This way, we can filter the Power Apps collection by choice value.

Filter Power Apps Collection By Person/Group Column

This section will explain how to filter the Power Apps collection by the Person/group column.

In the above SharePoint list [Loan Approval], there is a Person column called Loan Handled by.

The combo box is connected to the above SharePoint list person column. When a user selects a particular user from the combo box and clicks the Search button, the gallery displays all the details of the specific user.

Power Apps filter collection by person column
  • In the Power Apps app, connect the Office 365Users connector to the app.
Power Apps filter collection by person or group column using SharePoint list
  • Write the code below on Combobox’s Items property:
Office365Users.SearchUser({searchTerm:cmb_LoanHandledBy.SearchText,top:10})

cmb_LoanHandledBy = Combo box control name

Filter Power Apps collection by person column
  • On the Combo box control property pane, change the Fields layout to Person and enable the “Allow Searching.”
How to filter Power Apps collection by combo box control SharePoint list
  • Insert the Button control and set its OnSelect property:
ClearCollect(
    colUsers,
    Filter(
        'Loan Approval',
        'Loan Handled By'.DisplayName in cmb_LoanHandledBy.Selected.DisplayName
    )
)

Where.

  1. colUsers = Collection name
  2. cmb_LoanHandledBy = Combo box control name
install and configure Active directory windows server 2012 r2
  • Insert a Data table -> Set its Items property to:
colUsers
Filter collection by person column in Power Apps

Power Apps Filter Collection Based On Sharepoint Multiselect Person

Here, let me show you how to filter the Power Apps collection on the multi-select person field in SharePoint.

I have a SharePoint list [IT Support Ticket] that has various columns like:

Column NameData Type
Issue IDTitle
Issue Single line of text
Issue TypeChoice [Laptop, Network, Outlook, Others]
Issue Handled ByPerson/group
Power Apps filter collection on multiselect person field in the SharePoint

In the SharePoint person field [Issue Handled By], you must select “Allows multiple selections.”

How to filter collection by current user in Power Apps

Whenever I select multiple users from the combo box control and click the search icon, the gallery will display the records based on the selected users.

Filter Power Apps collection on multiselect person field in SharePoint

Let me show you how to achieve this:

  • On the Power Apps screen, insert a Combo box control -> Connect the combo box to an Office365Users as shown above:
Office365Users.SearchUser({searchTerm: cmb_IssueHandledBy.SearchText}).DisplayName

Where,

  1. cmb_IssueHandledBy = Combo box control name
How to filter Power Apps collection on multiselect person field
  • Insert a Search icon -> Set its OnSelect property to:
ClearCollect(
    colSP,
    'IT Support Ticket'
);
Collect(
    colIssueHandledBy,
    Filter(
        colSP,
        User().Email in 'Issue Handled By'.Email
    )
)

Where,

  1. colSP = Provide the collection name for the SharePoint list
  2. IT Support Ticket = SharePoint list name
  3. colIssueHandledBy = Provide the collection name for the person column.
  4. Issue Handled By = SharePoint list person column name
Filter collection on multiselect person field in Power Apps
  • Insert a Gallery control -> Set its Items property to:
colIssueHandledBy

Where,

  1. colIssueHandledBy = Collection name
How to filter Power Apps collection on multiselect person field in SharePoint

This is how we can filter the Power Apps collection on a multi-select person field in SharePoint.

Filter Power Apps Collection By Yes No Column

Now, we will see how to filter the Power Apps collection by a SharePoint Yes No column.

In the same SharePoint list [Loan Approval], there is a Yes/no column called Approved or Not.

If a user toggles to Approved, the data table will filter and display all the approved record details, and if the user turns off the toggle, the data table will filter and display the records that are not approved.

How to Filter Power Apps Collection By Yes No Column

Let us see how to achieve it:

  • On the Power Apps screen, insert a Toggle control -> Set its OnChange property to:
ClearCollect(coltoggle,Filter('Loan Approval','Approved or Not'=true))

Where,

  1. coltoggle = New collection name
  2. Loan Approval = SharePoint list name
  3. Approved or Not = SharePoint list yes/no type column name
How to filter collection using Yes or No column in Power Apps
  • Now, insert a Data table -> Set its Items property to:
If(
    tgl_ApprovedOrNot.Value = true,
    coltoggle,
    Filter(
        'Loan Approval',
        'Approved or Not' = false
    )
)

Where,

  1. tgl_ApprovedOrNot = Toggle control name
  2. coltoggle = Collection name
How to Filter Power Apps Collection By Yes No Column
  • Save, Publish, and Preview the app. When the user provides a toggle control to yes, the data table will filter and deliver particular data based on approved loans.
Power Apps filter collection using a SharePoint list yes or no column
  • Also, if the user provides a toggle control to NO, the data table will filter and display the records that are not approved.
Filter Collection By Yes No Column in Power Apps

Conclusion

From this Power Apps tutorial, we learned how to filter a Power Apps collection. We have also covered the topics below, such as the Power Apps collection filter SharePoint list, Power Apps collection filter by date, Power Apps collection filter by the current user, and many more.

You may like the following Power Apps tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…