Forum Discussion
druuby
Nov 02, 2023Copper Contributor
Microsoft Teams Adpative card on clicking button how to open browser window as popup
On clicking the button in Microsoft Teams Adaptive card how to open the browser window as a popup. Eg: In the Teams Jira cloud app clicking the sign-in button under the adaptive card opens the b...
Meghana-MSFT
Nov 02, 2023Former Employee
druuby -
In general, Adaptive Cards in Teams do not directly support opening a browser window as a popup. They can, however, trigger a Task Module which can then open a webpage in a popup-like experience within Teams.
Here's a sample code snippet that shows how to open a Task Module from an Adaptive Card:
{
"type": "Action.Submit",
"title": "Open Popup",
"data": {
"msteams": {
"type": "task/fetch"
}
}
}
When this button is clicked, your app will receive an Invoke activity with name task/fetch. Your app should respond to this Invoke activity with a Task Module response that includes the URL of the webpage to open:
{
"task": {
"type": "continue",
"value": {
"title": "My Popup",
"url": "https://www.example.com",
"height": "medium",
"width": "medium"
}
}
}
This will open the webpage in a Task Module, which is a popup-like experience within Teams. However, it will not open a new browser window or tab.