Forum Discussion

Ilamparithi520's avatar
Ilamparithi520
Copper Contributor
Aug 01, 2024

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.

Resources