cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2684
Views
0
Helpful
1
Replies

Webex Card with Choices

nathy1984
Level 1
Level 1

I try to create a Webex Card with choices

My attachment:

attachment = {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
            "type": "AdaptiveCard",
            "body": [
                {
                    "type": "TextBlock",
                    "text": "My Choices Card"
                },
                {
                    "type": "Input.ChoiceSet",
                    "placeholder": "Placeholder text",
                    "choices": [
                        {
                            "title": "Choice 1",
                            "value": "Choice 1"
                        },
                        {
                            "title": "Choice 2",
                            "value": "Choice 2"
                        }
                    ],
                    "style": "expanded"
                }
            ],
            "actions": [{
                "type": "Action.Submit",
                "title": "Submit"
            }],
            "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
            "version": "1.2"
        }
    }

Unfortunately no card will be show.

If I remove this part of the code, I can see a card with a text "My Choices Card" and a Button.

 

{
                    "type": "Input.ChoiceSet",
                    "placeholder": "Placeholder text",
                    "choices": [
                        {
                            "title": "Choice 1",
                            "value": "Choice 1"
                        },
                        {
                            "title": "Choice 2",
                            "value": "Choice 2"
                        }
                    ],
                    "style": "expanded"
                }

 

What is wrong with my attachment?

 

Best regards,

1 Accepted Solution

Accepted Solutions

mneiding
Cisco Employee
Cisco Employee

Your input choice field is missing a id attribute. This should work:

 

{
            "type": "AdaptiveCard",
            "body": [
                {
                    "type": "TextBlock",
                    "text": "My Choices Card"
                },
                {
                    "type": "Input.ChoiceSet",
                    "id": "test_id", # <- This is where you are missing the id
                    "placeholder": "Placeholder text",
                    "choices": [
                        {
                            "title": "Choice 1",
                            "value": "Choice 1"
                        },
                        {
                            "title": "Choice 2",
                            "value": "Choice 2"
                        }
                    ],
                    "style": "expanded"
                }
            ],
            "actions": [{
                "type": "Action.Submit",
                "title": "Submit"
            }],
            "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
            "version": "1.2"
        }

View solution in original post

1 Reply 1

mneiding
Cisco Employee
Cisco Employee

Your input choice field is missing a id attribute. This should work:

 

{
            "type": "AdaptiveCard",
            "body": [
                {
                    "type": "TextBlock",
                    "text": "My Choices Card"
                },
                {
                    "type": "Input.ChoiceSet",
                    "id": "test_id", # <- This is where you are missing the id
                    "placeholder": "Placeholder text",
                    "choices": [
                        {
                            "title": "Choice 1",
                            "value": "Choice 1"
                        },
                        {
                            "title": "Choice 2",
                            "value": "Choice 2"
                        }
                    ],
                    "style": "expanded"
                }
            ],
            "actions": [{
                "type": "Action.Submit",
                "title": "Submit"
            }],
            "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
            "version": "1.2"
        }