cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
186
Views
0
Helpful
1
Replies
Highlighted
Beginner

Webex Card with Choices

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
Highlighted
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
Highlighted
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

This widget could not be displayed.