I am creating an adaptive card that requires that I repeat some elements in an array using the Designer. I am trying to create a list of items for an invoice so I need to repeat items in the cart....
I have a template with this container with the element that need to be repeated:
{
"type": "Container",
"items": [
{
"type": "Container",
"items": [
{
"$data": "${items}",
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"wrap": true,
"text": "${quantity}"
}
],
"width": "auto"
},
{
"type": "Column",
"spacing": "Medium",
"items": [
{
"type": "TextBlock",
"wrap": true,
"text": "${product.name}"
}
],
"width": "stretch"
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "${cost}",
"wrap": true
}
],
"width": "auto"
},
{
"type": "Column",
"id": "chevronDown1",
"spacing": "Small",
"verticalContentAlignment": "Center",
"items": [
{
"type": "Image",
"selectAction": {
"type": "Action.ToggleVisibility",
"title": "collapse",
"targetElements": [
"cardContent1",
"chevronUp1",
"chevronDown1"
]
},
"url": "https://adaptivecards.io/content/down.png",
"width": "20px",
"altText": "collapsed"
}
],
"width": "auto"
},
{
"type": "Column",
"id": "chevronUp1",
"isVisible": false,
"spacing": "Small",
"verticalContentAlignment": "Center",
"items": [
{
"type": "Image",
"selectAction": {
"type": "Action.ToggleVisibility",
"title": "expand",
"targetElements": [
"cardContent1",
"chevronUp1",
"chevronDown1"
]
},
"url": "https://adaptivecards.io/content/up.png",
"width": "20px",
"altText": "expanded"
}
],
"width": "auto"
}
]
},
{
"type": "Container",
"id": "cardContent1",
"isVisible": false,
"items": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"isSubtle": true,
"wrap": true,
"text": "${product.description}"
}
]
}
]
}
],
}
],
}
and sample data that looks something like this:
{
"items": [
{
"quantity": "1",
"unitCost": "55",
"cost": "55",
"product": {
"name": "Product 1",
"description": "Lorem ipsum dolor sit amet"
}
}, {
"quantity": "2",
"unitCost": "55",
"cost": "55",
"product": {
"name": "Product 2",
"description": "Lorem ipsum dolor sit amet"
}
}
]
}
I followed the example here but I cannot get the same effect... I am presuming it is cause I have nested elements.