Forum Discussion

sowmyaseetha's avatar
sowmyaseetha
Copper Contributor
Sep 27, 2023
Solved

Table in adaptive cards

  This is my data for table  where the buckets in billingproviderskick will be having many no of objects so , i want to implement this in a table , then i have tried in this as provided in the below...
  • Prasad_Das-MSFT's avatar
    Sep 28, 2023

    sowmyaseetha - 

    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.

Resources