Forum Discussion
bot popup in teams
Hi, I'm trying to create a bot app in Teams that will display some information on the adaptive cards. The adaptive cards will have 2 buttons(Yes, No). Both buttons have an action type as "Action. Submit". Earlier when the user clicked the button, the received event will have the type "invoke", but now I received the event type as "message".
I'm trying to show a modal popup that contains some input fields and a submit button when the no button is clicked. I'm unable to do it now.
CARD:
{
"type": "message",
"attachments": [
{
"ContentType": "application/vnd.microsoft.card.adaptive",
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "TextBlock",
"text": "Some text",
"wrap": true,
"size": "medium",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "Some text",
"wrap": true,
"size": "Default"
}
],
"actions": [
{"type": "Action.Submit", "title": "Yes", "data": {}},
{"type": "Action.Submit", "title": "No", "data": {}},
],
},
}
]
}
On receiving the no button clicked event, I'm responding with
{
"task": {
"type": "continue",
"value": {
"card": {
"ContentType": "application/vnd.microsoft.card.adaptive",
"content": {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "Input.Text",
"id": "Some text",
"placeholder": "Enter your text",
"isRequired": true,
"errorMessage": "This field is required",
}
],
"actions": [
{"type": "Action.Submit", "title": "Submit", "data":{}}
],
},
}
},
}
}
But the popup is not displayed.
- Meghana-MSFTMicrosoftThank you for reporting this, we will check this and get back to you.
- Meghana-MSFTMicrosoft
Ilamparithi520 - We checked this at our end using the following sample - https://github.com/OfficeDev/Microsoft-Teams-Samples/tree/main/samples/bot-task-module/csharp.
We are able to successfully invoke task module from adaptive card button. Could you please check this sample once again and let us know if you are still facing this issue?