Samples and Templates

These samples are just a teaser of the type of cards you can create. Go ahead and tweak them to make any scenario possible!

Choose sample:

Templating enables the separation of data from the layout in an Adaptive Card. It helps design a card once, and then populate it with real data at runtime. Note: The binding syntax changed in May 2020. Get started with templating

Inputs with validation sample

JSON
{
	"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
	"type": "AdaptiveCard",
	"version": "1.0",
	"body": [
		{
			"type": "TextBlock",
			"size": "medium",
			"weight": "bolder",
			"text": "Input.Text elements",
			"horizontalAlignment": "center"
		},
		{
			"type": "Input.Text",
			"label": "Name",
			"style": "text",
			"id": "SimpleVal",
			"isRequired": true,
			"errorMessage": "Name is required"
		},
		{
			"type": "Input.Text",
			"label": "Homepage",
			"style": "url",
			"id": "UrlVal"
		},
		{
			"type": "Input.Text",
			"label": "Email",
			"style": "email",
			"id": "EmailVal"
		},
		{
			"type": "Input.Text",
			"label": "Phone",
			"style": "tel",
			"id": "TelVal"
		},
		{
			"type": "Input.Text",
			"label": "Comments",
			"style": "text",
			"isMultiline": true,
			"id": "MultiLineVal"
		},
		{
			"type": "Input.Number",
			"label": "Quantity",
			"min": -5,
			"max": 5,
			"value": 1,
			"id": "NumVal",
			"errorMessage": "The quantity must be between -5 and 5"
		},
		{
			"type": "Input.Date",
			"label": "Due Date",
			"id": "DateVal",
			"value": "2017-09-20"
		},
		{
			"type": "Input.Time",
			"label": "Start time",
			"id": "TimeVal",
			"value": "16:59"
		},
		{
			"type": "TextBlock",
			"size": "medium",
			"weight": "bolder",
			"text": "Input.ChoiceSet",
			"horizontalAlignment": "center"
		},
		{
			"type": "Input.ChoiceSet",
			"id": "CompactSelectVal",
			"label": "What color do you want? (compact)",
			"style": "compact",
			"value": "1",
			"choices": [
				{
					"title": "Red",
					"value": "1"
				},
				{
					"title": "Green",
					"value": "2"
				},
				{
					"title": "Blue",
					"value": "3"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "SingleSelectVal",
			"label": "What color do you want? (expanded)",
			"style": "expanded",
			"value": "1",
			"choices": [
				{
					"title": "Red",
					"value": "1"
				},
				{
					"title": "Green",
					"value": "2"
				},
				{
					"title": "Blue",
					"value": "3"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "MultiSelectVal",
			"label": "What colors do you want? (multiselect)",
			"isMultiSelect": true,
			"value": "1,3",
			"choices": [
				{
					"title": "Red",
					"value": "1"
				},
				{
					"title": "Green",
					"value": "2"
				},
				{
					"title": "Blue",
					"value": "3"
				}
			]
		},
		{
			"type": "TextBlock",
			"size": "medium",
			"weight": "bolder",
			"text": "Input.Toggle",
			"horizontalAlignment": "center"
		},
		{
			"type": "Input.Toggle",
			"label": "Please accept the terms and conditions:",
			"title": "I accept the terms and conditions (True/False)",
			"valueOn": "true",
			"valueOff": "false",
			"id": "AcceptsTerms",
			"isRequired": true,
			"errorMessage": "Accepting the terms and conditions is required"
		},
		{
			"type": "Input.Toggle",
			"label": "How do you feel about red cars?",
			"title": "Red cars are better than other cars",
			"valueOn": "RedCars",
			"valueOff": "NotRedCars",
			"id": "ColorPreference"
		}
	],
	"actions": [
		{
			"type": "Action.Submit",
			"title": "Submit",
			"data": {
				"id": "1234567890"
			}
		},
		{
			"type": "Action.ShowCard",
			"title": "Show Card",
			"card": {
				"type": "AdaptiveCard",
				"body": [
					{
						"type": "Input.Text",
						"label": "enter comment",
						"style": "text",
						"id": "CommentVal"
					}
				],
				"actions": [
					{
						"type": "Action.Submit",
						"title": "OK"
					}
				]
			}
		}
	]
}
Data JSON
{
    "ParticipantInfoForm":{
        "title":"Input.Text elements"
    },
    "Survey": {
        "title":"Input ChoiceSet",
        "questions": [
                {
                    "question":"What color do you want? (compact)",
                    "items": [
                        {
                            "choice":"Red",
                            "value":"1"
                        },
                        {
                            "choice":"Green",
                            "value":"2"
                        },
                        {
                            "choice":"Blue",
                            "value":"3"
                        }
                    ]
                },
                {
                    "question": "What color do you want? (expanded)",
                    "items": [
                        {
                            "choice":"Red",
                            "value":"1"
                        },
                        {
                            "choice":"Green",
                            "value":"2"
                        },
                        {
                            "choice":"Blue",
                            "value":"3"
                        }
                    ]
                },
                {
                    "question": "What color do you want? (multiselect)",
                    "items": [
                        {
                            "choice":"Red",
                            "value":"1"
                        },
                        {
                            "choice":"Green",
                            "value":"2"
                        },
                        {
                            "choice":"Blue",
                            "value":"3"
                        }
                    ]
                },
                {
                    "question":"I accept the terms and conditions (True/False)"
                },
                {
                    "question":"Red cars are better than other cars"
                }
            ]
        }
}
Template JSON
{
	"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
	"type": "AdaptiveCard",
	"version": "1.0",
	"body": [
		{
			"type": "TextBlock",
			"size": "medium",
			"weight": "bolder",
			"text": " ${ParticipantInfoForm.title}",
			"horizontalAlignment": "center"
		},
		{
			"type": "Input.Text",
			"label": "Name",
			"style": "text",
			"id": "SimpleVal",
			"isRequired": true,
			"errorMessage": "Name is required"
		},
		{
			"type": "Input.Text",
			"label": "Homepage",
			"style": "url",
			"id": "UrlVal"
		},
		{
			"type": "Input.Text",
			"label": "Email",
			"style": "email",
			"id": "EmailVal"
		},
		{
			"type": "Input.Text",
			"label": "Phone",
			"style": "tel",
			"id": "TelVal"
		},
		{
			"type": "Input.Text",
			"label": "Comments",
			"style": "text",
			"isMultiline": true,
			"id": "MultiLineVal"
		},
		{
			"type": "Input.Number",
			"label": "Quantity",
			"min": -5,
			"max": 5,
			"value": 1,
			"id": "NumVal",
			"errorMessage": "The quantity must be between -5 and 5"
		},
		{
			"type": "Input.Date",
			"label": "Due Date",
			"id": "DateVal",
			"value": "2017-09-20"
		},
		{
			"type": "Input.Time",
			"label": "Start time",
			"id": "TimeVal",
			"value": "16:59"
		},
		{
			"type": "TextBlock",
			"size": "medium",
			"weight": "bolder",
			"text": "${Survey.title} ",
			"horizontalAlignment": "center"
		},
		{
			"type": "Input.ChoiceSet",
			"id": "CompactSelectVal",
			"label": "${Survey.questions[0].question}",
			"style": "compact",
			"value": "1",
			"choices": [
				{
					"$data": "${Survey.questions[0].items}",
					"title": "${choice}",
					"value": "${value}"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "SingleSelectVal",
			"label": "${Survey.questions[1].question}",
			"style": "expanded",
			"value": "1",
			"choices": [
				{
					"$data": "${Survey.questions[1].items}",
					"title": "${choice}",
					"value": "${value}"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "MultiSelectVal",
			"label": "${Survey.questions[2].question}",
			"isMultiSelect": true,
			"value": "1,3",
			"choices": [
				{
					"$data": "${Survey.questions[2].items}",
					"title": "${choice}",
					"value": "${value}"
				}
			]
		},
		{
			"type": "TextBlock",
			"size": "medium",
			"weight": "bolder",
			"text": "Input.Toggle",
			"horizontalAlignment": "center"
		},
		{
			"type": "Input.Toggle",
			"label": "Please accept the terms and conditions:",
			"title": "${Survey.questions[3].question}",
			"valueOn": "true",
			"valueOff": "false",
			"id": "AcceptsTerms",
			"isRequired": true,
			"errorMessage": "Accepting the terms and conditions is required"
		},
		{
			"type": "Input.Toggle",
			"label": "How do you feel about red cars?",
			"title": "${Survey.questions[4].question}",
			"valueOn": "RedCars",
			"valueOff": "NotRedCars",
			"id": "ColorPreference"
		}
	],
	"actions": [
		{
			"type": "Action.Submit",
			"title": "Submit",
			"data": {
				"id": "1234567890"
			}
		},
		{
			"type": "Action.ShowCard",
			"title": "Show Card",
			"card": {
				"type": "AdaptiveCard",
				"body": [
					{
						"type": "Input.Text",
						"label": "enter comment",
						"style": "text",
						"id": "CommentVal"
					}
				],
				"actions": [
					{
						"type": "Action.Submit",
						"title": "OK"
					}
				]
			}
		}
	]
}
Adaptive Card