Forum Discussion
Table in adaptive cards
- Sep 28, 2023
To repeat the rows instead, you should set the "$data" property at the TableRow level.
{ "type": "AdaptiveCard", "body": [ { "type": "Table", "columns": [ { "width": 1 }, { "width": 1 } ], "rows": [ { "$data": "${billingProvidersKick.buckets}", "type": "TableRow", "cells": [ { "type": "TableCell", "items": [ { "type": "TextBlock", "text": "${val}", "spacing": "Small" }, // ... rest of your code ] }, // ... rest of your code ] } ] } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.5" }
In this JSON, the "$data" property is set at the TableRow level, which means that for each object in the "buckets" array, a new row will be created in the table.
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link.
To repeat the rows instead, you should set the "$data" property at the TableRow level.
{
"type": "AdaptiveCard",
"body": [
{
"type": "Table",
"columns": [
{
"width": 1
},
{
"width": 1
}
],
"rows": [
{
"$data": "${billingProvidersKick.buckets}",
"type": "TableRow",
"cells": [
{
"type": "TableCell",
"items": [
{
"type": "TextBlock",
"text": "${val}",
"spacing": "Small"
},
// ... rest of your code
]
},
// ... rest of your code
]
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}
In this JSON, the "$data" property is set at the TableRow level, which means that for each object in the "buckets" array, a new row will be created in the table.
Thanks,
Prasad Das
------------------------------------------------------------------------------------------
If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link.