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:
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
Open Power Apps.
Create a Blank Canvas App.
Choose Tablet or Phone layout.
Step 2: Add Office 365 Users Connector
Select Data.
Click Add Data.
Search for:
Office 365 Users
Add the connector.
Step 3: Insert Controls
Add the following controls:
| Control | Name |
|---|
| Text Input | txtSearchUser |
| Vertical Gallery | galUsers |
| Image | imgUser |
| Labels | lblName, lblEmail |
| Button/Icon | icoSelect |
| Horizontal Gallery | galSelectedUsers (Optional for multi-select) |
Step 4: Search Users
Set the Items property of galUsers
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
Office365Users.UserPhotoV2(ThisItem.Id)
Display Name
ThisItem.DisplayName
Email
ThisItem.Mail
Job Title (Optional)
ThisItem.JobTitle
Department (Optional)
ThisItem.Department
Step 6: Select User
Create a variable when selecting a user.
OnSelect
Set(varSelectedUser, ThisItem)
Display selected user
Name Label
varSelectedUser.DisplayName
Email
varSelectedUser.Mail
Photo
Office365Users.UserPhotoV2(varSelectedUser.Id)
Step 7: Clear Selection
Button
Set(varSelectedUser, Blank())
Step 8: Multi-User Selection
Instead of a variable, use a collection.
OnSelect
Collect(
colSelectedUsers,
ThisItem
)
Avoid duplicate users
If(
IsBlank(
LookUp(
colSelectedUsers,
Id = ThisItem.Id
)
),
Collect(
colSelectedUsers,
ThisItem
)
)
Remove a user
Remove(
colSelectedUsers,
ThisItem
)
Gallery Items
colSelectedUsers
Step 9: Search Only After Three Characters
To reduce unnecessary API calls:
If(
Len(txtSearchUser.Text) >= 3,
Office365Users.SearchUserV2(
{
searchTerm: txtSearchUser.Text,
top: 20
}
).value
)
Step 10: Display "No Results Found"
Label Visible property
CountRows(galUsers.AllItems)=0 &&
Len(txtSearchUser.Text)>=3
Text
No users found.
Step 11: Patch Selected User to SharePoint Person Column
For a single Person column:
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
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.