How to Filter Power Apps Gallery by Person

Would you like to work with Power Apps Filter Gallery by Person, or want to see a few examples of it? This Power Apps tutorial will teach you how to filter the Person field within the Power Apps gallery in various scenarios if that’s the case.

Power Apps Filter Gallery by Person

Let us understand how to filter the Person field within the Power Apps.

Example – 1: [Power Apps Filter Gallery by Person Using Combo box Control]

  • For example, Let’s say, there is a Power Apps Gallery control and a Combo box control. The combo box control contains all the Manager names.
  • When a user selects any specific manager from the combo box, the gallery will filter and display all the filtered records based on the selected manager.
  • If I select Preeti, the gallery will display all the filtered records of Manager Preeti.
Power Apps Filter Gallery by Person with examples
Power Apps Filter Gallery by Person with examples

Here we will see how we can achieve this above requirement.

I have taken a SharePoint Online list [Employee Leave Details] for this example. This list has a Person or Group column named Manager.

Power Apps Filter Gallery by Person examples
Power Apps Filter Gallery by Person examples

Two Managers handle the Leave Requests. Such as:

  1. Sonam Subhadarshini
  2. Preeti Sahu
  • Go to the Power Apps screen and insert a Combo Box control (+ Insert -> Search Combo box in the search bar -> Select Combo box). Just rename the Combo box control’s name to cmb_Manager.
  • Next, we must connect the SharePoint list data source connector (EmployeeLeaveDetails) to the app.
Power Apps Gallery Filter by Person
Power Apps Gallery Filter by Person
  • Next, to filter the record, Select the Combo box control and apply the code below on its Items property:
Distinct(EmployeeLeaveDetails,Manager.DisplayName)

Where,

  1. Distinct = Distinct function removes the Duplicates values, then it evaluates across each record table and returns a result as a one-column table.
  2. EmployeeLeaveDetails = SharePoint Online list name
  3. Manager = SharePoint Person or group Column name
Power Apps Gallery Filter by Person with examples
Power Apps Gallery Filter by Person with examples
  • Then change the Combo box property to InputTextPlaceHolder as:
"Find Manager"

Then the Combo box looks with a text input as shown below:

Power Apps Gallery Filter by Person with an examples
Power Apps Gallery Filter by Person with an examples
  • Next, select the Gallery control and apply the code below on its Items property:
Filter(EmployeeLeaveDetails,Manager.DisplayName in cmb_Manager.SelectedItems)

Where,

  1. EmployeeLeaveDetails = SharePoint Online list name
  2. Manager = SharePoint Person or group Column name
  3. cmb_Manager = Combo box control name
Power Apps Gallery Filter by Person examples
Power Apps Gallery Filter by Person examples
  • Now Save and Publish the app. Preview the app, click on the Combobox, and select any Manager’s Name.
Power Apps Filter Gallery by Person
Power Apps Filter Gallery by Person
  • You can see the gallery will filter and provide the specific filtered record as below.
Power Apps Filter Gallery by Person with an examples
Power Apps Filter Gallery by Person with an examples

This is how to work with Power Apps Filter Gallery by Person using Combo box.

Check out: How to Show Hide Power Apps Label Control On Button Click

Example – 2: [Power Apps Filter Gallery by Person Without Using any Control]

  • I will take the same SharePoint list [Employee Leave Details] for this example. This list has a Person or Group column named Manager.
  • Two Managers handle the Leave Requests in the SharePoint Online list.
  • In this example, I will write a formula that helps to filter the Power Apps gallery based on a specific user. For this, we do not need to take any extra input control to search any manager’s name.
  • The below screenshot represents all the filtered records of a Manager.
Power Apps canvas app Gallery Filter by Person
Power Apps canvas app Gallery Filter by Person

Follow the instructions below for how we can achieve it.

  • Next, to filter the record, Select the Gallery control and apply the code below on its Items property:
Filter(EmployeeLeaveDetails, Manager.DisplayName ="Sonam Subhadarsini")

Where,

  • EmployeeLeaveDetail = SharePoint Online List name
  • Manager = SharePoint Person or group column name
  • Sonam Subhadarsini = The Manager name who handles all the Leave Approval
Power Apps Gallery Filter using Person or group column
Power Apps Gallery Filter using Person or group column
  • Now Save and Publish the app. Preview the app, You can see the gallery will filter and provide the specific filtered record of the particular manager (Sonam Subhadarsini) as below.

This is how to work with Power Apps Filter Gallery by Person directly without using any Power Apps control.

Furthermore, you may like some more Power Apps tutorials:

Conclusion

This Power Apps tutorial taught us how to filter the Person field within the Power Apps gallery in various scenarios, such as

  • Power Apps Filter Gallery by Person Using Combo Box Control
  • Power Apps Filter Gallery by Person Without Using any Control