Task modules permit you to create modal pop-up experiences in your Teams application. In the pop-up, you can:
- Show an
<iframe>-based widget such as a YouTube or Microsoft Stream video.
- Display an Adaptive Card.
Task modules are useful for initiating and completing tasks or displaying rich information, such as videos or Power Business Intelligence (BI) dashboards. A pop-up experience is often more natural for users initiating and completing tasks compared to a tab or a conversation-based bot experience.
Task modules can be invoked in three ways:
- Channel or personal tabs: Using the TeamsJS library, you can invoke task modules from buttons, links, or menus on your tab. For more information, see using task modules in tabs.
- Bots: Using buttons on cards sent from your bot. This is useful when you don't require everyone in a channel to see what you are doing with a bot. For example, when having users respond to a poll in a channel it isn't useful to see a record of that poll being created. For more information, see using task modules from Teams bots.
- Outside of Teams from a deep link: You can also create URLs to invoke a task module from anywhere. For more information, see task module deep link syntax.
Components of a task module
Here's what a task module looks like when invoked from a bot:
A task module includes the following as shown in the previous image:
The task module's title specified in the
titleproperty of the TaskInfo object.
The task module's close or cancel button. If the user selects this button, your app receives an
errevent. For more information, see example for submitting the result of a task module.
It is currently not possible to detect the
errevent when a task module is invoked from a bot.
If you're displaying an Adaptive Card using the
Adaptive Card buttons render after you select Sign up. When using your own page, create your own buttons. By design, the primary button style (solid) is applied to the last root action in an Adaptive Card. For all other actions, the default button style is applied.