Microsoft Teams Channel Picker component in Microsoft Graph Toolkit
Article
You can use the mgt-teams-channel-picker component to enable searches for Microsoft Teams channels associated with a user. The component can search all teams the user has joined, and each channel in those teams.
Example
The following example shows the mgt-teams-channel-picker component. Start searching for a channel or team to see the results render.
Use the selectedItem property to retrieve the currently selected channel and parent team. This value will be null if no channel has been selected. selectedItem contains two properties: channel (MicrosoftGraph.Channel) and team (MicrosoftGraph.Team).
Fires when the user makes a change in the selection of a channel
The currently selected item as { channel: channel, team: team}
No
No
Yes
For more information about handling events, see events.
Templates
mgt-teams-channel-picker supports several templates that you can use to replace certain parts of the component. To specify a template, include a <template> element inside a component and set the data-type to one of the following values.
Data type
Data context
Description
loading
null: no data
The template used to render the state of the picker while making a request to Microsoft Graph is being made.
error
null: no data
The template used if a user search returns no users.
The following example shows how to use the error template.
HTML
<mgt-teams-channel-picker><templatedata-type="error"><p>Sorry, no Teams or Channels were found</p></template></mgt-teams-channel-picker>
Microsoft Graph permissions
This component uses the following Microsoft Graph APIs and permissions by default. For each API called the user must have at least one of the listed permissions.
Learn how to build and distribute Microsoft Teams apps that retrieve user information using the Microsoft Graph API. Practice building and deploying apps in the guided project at the end of the learning path.
Demonstrate skills to plan, deploy, configure, and manage Microsoft Teams to focus on efficient and effective collaboration and communication in a Microsoft 365 environment.