People Picker is an input control in Teams that allows users to search and select people. You can integrate People Picker input control in a web app, which allows end users to perform different functions such as, search and select people in a chat, channel, or across the organization within Teams. The People Picker control is available across all Teams clients, such as web, desktop, and mobile.
Works on all Teams capabilities, such as dialog (referred as task module in TeamsJS v1.x), chat, channel, meeting tab, and personal app.
Allows the user to search and select people in a chat, channel, or the entire organization within Teams.
Helps in scenarios involving task assignment, tagging, and notifying user.
Saves significant time and effort in comparison to building any similar control.
To integrate People Picker input control in your Teams app, use the selectPeople API. To integrate and call the API, you must have a good understanding of accompanying code snippet. You also need familiarity with API response errors.
selectPeople API
The selectPeople API enables you to add Teams People Picker input control to the web apps and also helps you with the following:
Allows the user to search and select one or more people from the list.
Returns the ID, name, and email address of selected users to the web app.
In a personal app, the control searches for name or email ID across the organization within Teams. If the app is added to a chat or channel, then the search context is configured based on the scenario. The search is restricted within the members of that chat or channel.
The selectPeople API comes with the following input configurations:
Configuration parameter
Type
Description
Default value
title
String
It's an optional parameter and sets the title for the People Picker control.
selectPeople
setSelected
String
It's an optional parameter. You must pass Microsoft Entra IDs of the people to be preselected. This parameter preselects people while launching the People Picker input control. In a single selection, only the first valid user is pre-populated ignoring the rest.
Null
openOrgWideSearchInChatOrChannel
Boolean
It's an optional parameter and when set to true, it launches the People Picker in organization wide scope even if the app is added to a chat or channel.
False
singleSelect
Boolean
It's an optional parameter and when set to true, it launches the People Picker and restricts the selection to only one user.
False
The following image displays the experience of People Picker on mobile and desktop:
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Platform Docs feedback
Platform Docs is an open source project. Select a link to provide feedback:
The Microsoft Teams JavaScript client library can help you integrate native Teams features right in your application. In this module, you'll learn how to integrate the Teams chat capability in your app by using the Teams JavaScript client library.