I can't seem to get this to work. If I send the following adaptive card payload to MS Teams:
{
"$schema" : "http://adaptivecards.io/schemas/adaptive-card.json",
"version" : "1.3",
"type" : "AdaptiveCard",
"body" : [ {
"type" : "Container",
"style" : "emphasis",
"items" : [ {
"type" : "Input.Text",
"value" : "${form.name}",
"id" : "name",
"label" : "Name"
} ]
} ],
"$data" : {
"form" : {
"name" : "geoff hurst"
},
}
}
I get a response in Teams like this:
I would have thought that the template should be expanded on the client-side, but this doesn't seem to happen. Have I misunderstood?
So in simple terms, Teams doesn't have an ability to render templates (basically that would mean taking the card template and the data payload and combining them together) - it can only accept the final version of the card.
As a result, if you're wanting to use templates, then you need to implement the data + template capability your side, to send the final card payload down to Teams. See here for examples on how to do this in js or dotnet. Truth be told, if you're in js (e.g. Node), Templating is not much more than string replacement, and if you're in dotnet (e.g. C#) there's a strongly-typed Adaptive Card library you might want to rather use anyway, in which case you're combining the "template" and the "data" already inside your code.
I think probably the best use of templating would be if you're receiving a template from some kind of "template repository", but I don't think there's really practically any such thing yet for Teams.