07-06-2020 02:55 AM
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,
Solved! Go to Solution.
07-07-2020 02:34 AM
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" }
07-07-2020 02:34 AM
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" }
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: