Introduction

A People Picker is one of the most commonly used controls in business applications. It allows users to search and select people from your organization, making it ideal for assigning tasks, approving requests, selecting managers, or adding team members.

Although Power Apps provides a Person column for SharePoint forms, there are many scenarios where you need a custom People Picker that gives you greater flexibility and works independently of SharePoint forms.

In this article, you'll learn how to build a Custom People Picker Control using the Office365Users connector in Power Apps.

Prerequisites

Before starting, ensure you have:

  • Microsoft Power Apps

  • Office 365 Users Connector

  • Basic knowledge of Power Fx

  • An Office 365 account

What We'll Build

Our custom People Picker will include:

  • Search users by name or email

  • Display user profile picture

  • Show display name and email

  • Select a user

  • Remove selected user

  • Support single or multiple user selection

Step 1: Create a Canvas App

  1. Open Power Apps.

  2. Create a Blank Canvas App.

  3. Choose Tablet or Phone layout.

Step 2: Add Office 365 Users Connector

  1. Select Data.

  2. Click Add Data.

  3. Search for:

Code
Office 365 Users
  1. Add the connector.

Step 3: Insert Controls

Add the following controls:

ControlName
Text InputtxtSearchUser
Vertical GallerygalUsers
ImageimgUser
LabelslblName, lblEmail
Button/IconicoSelect
Horizontal GallerygalSelectedUsers (Optional for multi-select)

Step 4: Search Users

Set the Items property of galUsers

Code
If(
    IsBlank(txtSearchUser.Text),
    Blank(),
    Office365Users.SearchUserV2(
        {
            searchTerm: txtSearchUser.Text,
            top: 20
        }
    ).value
)

Now typing any name will search users from Microsoft Entra ID.

Step 5: Show User Information

Profile Picture

Image property

Code
Office365Users.UserPhotoV2(ThisItem.Id)

Display Name

Code
ThisItem.DisplayName

Email

Code
ThisItem.Mail

Job Title (Optional)

Code
ThisItem.JobTitle

Department (Optional)

Code
ThisItem.Department

Step 6: Select User

Create a variable when selecting a user.

OnSelect

Code
Set(varSelectedUser, ThisItem)

Display selected user

Name Label

Code
varSelectedUser.DisplayName

Email

Code
varSelectedUser.Mail

Photo

Code
Office365Users.UserPhotoV2(varSelectedUser.Id)

Step 7: Clear Selection

Button

Code
Set(varSelectedUser, Blank())

Step 8: Multi-User Selection

Instead of a variable, use a collection.

OnSelect

Code
Collect(
    colSelectedUsers,
    ThisItem
)

Avoid duplicate users

Code
If(
    IsBlank(
        LookUp(
            colSelectedUsers,
            Id = ThisItem.Id
        )
    ),
    Collect(
        colSelectedUsers,
        ThisItem
    )
)

Remove a user

Code
Remove(
    colSelectedUsers,
    ThisItem
)

Gallery Items

Code
colSelectedUsers

Step 9: Search Only After Three Characters

To reduce unnecessary API calls:

Code
If(
    Len(txtSearchUser.Text) >= 3,
    Office365Users.SearchUserV2(
        {
            searchTerm: txtSearchUser.Text,
            top: 20
        }
    ).value
)

Step 10: Display "No Results Found"

Label Visible property

Code
CountRows(galUsers.AllItems)=0 &&
Len(txtSearchUser.Text)>=3

Text

Code
No users found.

Step 11: Patch Selected User to SharePoint Person Column

For a single Person column:

Code
Patch(
    EmployeeRequests,
    Defaults(EmployeeRequests),
    {
        Employee: {
            '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
            Claims: "i:0#.f|membership|" & Lower(varSelectedUser.Mail),
            DisplayName: varSelectedUser.DisplayName,
            Email: varSelectedUser.Mail
        }
    }
)

Step 12: Save Multiple Users

Code
ForAll(
    colSelectedUsers,
    Patch(
        EmployeeAssignments,
        Defaults(EmployeeAssignments),
        {
            EmployeeEmail: Mail,
            EmployeeName: DisplayName
        }
    )
)

Conclusion

Building a custom People Picker in Power Apps gives you much greater flexibility than the default SharePoint Person field. By using the Office365Users connector, you can create a responsive user search experience with profile pictures, email addresses, and support for both single and multiple selections. This approach is ideal for approval workflows, employee directories, task assignment, and other enterprise applications where user selection is a core requirement.