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:

Adaptive Card 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. More about templating

Stock update sample

Data JSON
{
	"symbol": "MSFT",
	"companyName": "Microsoft Corporation",
	"primaryExchange": "Nasdaq Global Select",
	"sector": "Technology",
	"calculationPrice": "close",
	"open": 127.42,
	"openTime": 1556890200,
	"close": 128.9,
	"closeTime": 1556913600,
	"high": 129.43,
	"low": 127.25,
	"latestPrice": 128.9,
	"latestSource": "Close",
	"latestTime": "May 3, 2019",
	"latestUpdate": 1556913600,
	"latestVolume": 24835154,
	"iexRealtimePrice": null,
	"iexRealtimeSize": null,
	"iexLastUpdated": null,
	"delayedPrice": 128.9,
	"delayedPriceTime": 1556913600,
	"extendedPrice": 129.04,
	"extendedChange": 0.14,
	"extendedChangePercent": 0.00109,
	"extendedPriceTime": 1556917190,
	"previousClose": 126.21,
	"change": 2.69,
	"changePercent": 0.02131,
	"iexMarketPercent": null,
	"iexVolume": null,
	"avgTotalVolume": 22183270,
	"iexBidPrice": null,
	"iexBidSize": null,
	"iexAskPrice": null,
	"iexAskSize": null,
	"marketCap": 987737229888,
	"peRatio": 30.84,
	"week52High": 131.37,
	"week52Low": 93.96,
	"ytdChange": 0.30147812013916003
}
Template JSON
{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.0",
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "${companyName}",
                    "size": "Medium",
                    "wrap": true
                },
                {
                    "type": "TextBlock",
                    "text": "${primaryExchange}: ${symbol}",
                    "isSubtle": true,
                    "spacing": "Small",
                    "wrap": true
                },
                {
                    "type": "TextBlock",
                    "text": "{{DATE(${formatDateTime(latestUpdate, 'yyyy-MM-ddTHH:mm:ssZ')}, SHORT)}} {{TIME(${formatDateTime(latestUpdate, 'yyyy-MM-ddTHH:mm:ssZ')})}}"
                }
            ]
        },
        {
            "type": "Container",
            "spacing": "None",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "${latestPrice} ",
                                    "size": "ExtraLarge"
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "${if(change >= 0, '▲', '▼')} USD ${change}%",
                                    "color": "${if(change >= 0, 'good', 'attention')}",
                                    "spacing": "None"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "FactSet",
                                    "facts": [
                                        {
                                            "title": "Open",
                                            "value": "${open} "
                                        },
                                        {
                                            "title": "High",
                                            "value": "${high} "
                                        },
                                        {
                                            "title": "Low",
                                            "value": "${low} "
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}
Adaptive Card