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

Webex Card with Choices

nathy1984
Beginner
Beginner

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"
        }
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers