I was reading the Template Language documentation and saw that it's possible to use an array of strings to replicate a TextBlock element multiple times using the syntax "text": "${$data}
. However, when I try to replicate this in the online Designer, I do not get the intended result.
My attempt at using the construct described in the documentation:
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"text": "Names"
},
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"$data": [
"Matt",
"David",
"Thomas"
],
"text": "${$data}"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
}
Any help would be greatly appreciated. Thank you!
I didn't realize that Designer provides a separate Preview Mode for displaying these types of dynamic injections of data. When you enable Preview Mode, the data displays dynamically as intended. An example is the default card that loads when you open the Designer - the FactSet is not populated until you enable Preview Mode.
Answering my own question - it would appear displaying this sort of construct isn't supported by the Designer. I tried adding a card with the above JSON to my .NET project and it displays perfectly in Bot Framework Emulator.