How to Filter Power Apps Collection By Person/Group Column?

In this Power Apps tutorial, Let me show you how to filter the Power Apps Collection by Person/Group Column.

Moreover, I will explain how to filter a Power Apps collection by the current user. Also, we will discuss how to filter the Power Apps collection on the multi-select person field in SharePoint.

How to Filter Power Apps Collection By Person/Group Column

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

For Example, I have a SharePoint Online list as ” Loan Approval” that has various columns like:

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
How to Filter Power Apps Collection By Person/Group Column

I created a Power Apps Canvas app and added a Combo box control, a Search button, and a Data table.

The combobox 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 the result based on the selected user data.

Let’s say I selected one user, “Johanna Lorenz,” and click the Search button. Then, the data table will display all the records based on Johanna Lorenz, as shown below:

Power Apps filter collection by person column

Let us see how to achieve it:

  • Create a bank canvas app -> Connect a data source to Office 365Users.
Power Apps filter collection by person or group column using SharePoint list
  • Insert a Combo box control -> Set its Items property to:
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 beside the combo box control -> Set its OnSelect property to:
ClearCollect(
    colUsers,
    Filter(
        'Loan Approval',
        'Loan Handled By'.DisplayName in cmb_LoanHandledBy.Selected.DisplayName
    )
)

Where.

  1. colUsers = Provide the collection name
  2. Loan Approval = SharePoint list name
  3. Loan Handled By = SharePoint list person or group type
  4. cmb_LoanHandledBy = Combo box control name
How to filter Power Apps collection by person column
  • Insert a Data table -> Set its Items property to:
colUsers
Filter collection by person column in Power Apps
  • Save, Publish, and Preview the app when the user selects a user from the combo box control and clicks on a search button. The data table will filter and provide particular data based on the selected value.
How to filter collection by person column in Power Apps

We can filter the Power Apps collection using combo box control from a SharePoint list.

Power Apps Filter Collection By Current User

Here, I will explain how to filter the Power Apps collection by the current user.

For Example,

On my Power Apps screen, I have added the Data table control. Whenever the user loads the screen, the data table will filter and display the records based on the current user as shown below:

Power Apps filter collection by a current user

Let me show how to achieve this:

  • On the Power Apps Screen OnVisible property -> Create a Power Apps collection using the SharePoint list:
ClearCollect(colCurrentUser,'Loan Approval')

Where,

  1. colCurrentUser = Provide the collection name
  2. Loan Approval = SharePoint list name
Filter collection by a current user in Power Apps
  • On the Power Apps screen, insert a Data table -> Set its Items property to:
Filter(
    colCurrentUser,
    'Loan Handled By'.Email = User().Email
)

Where,

  1. colCurrentUser = Collection name
  2. Loan Handled By = SharePoint list person column name
How to filter Power Apps collection by current user
  • Save, Publish, Relaod, and Preview the app. The data table will filter and provide particular data based on the current user.
Filter Power Apps collection by current user

This is how we can filter the Power Apps collection by the current user.

Power Apps filter collection on Multiselect Person field in SharePoint

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

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

Column NameData Type
Issue IDTitle
Issue Single lien 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

I have created a blank canvas app and added a Combo box control and Gallery control. The combo box control is connected to the Office 365 Users.

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 using the above SharePoint list person field.

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
  • Save, Publish, Relaod, and Preview the app. 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.
Power Apps filter collection on multiselect person field using SharePoint

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

Conclusion

I hope this Power Apps tutorial gave you the complete information about “Power Apps filter collection by person/group column.”

Last, I have explained how to filter a Power Apps collection by the current user and how to filter the Power Apps collection on a multi-select person field in SharePoint.

Furthermore, you may like some more Power Apps tutorials: