Table template data display


(Arun P3) #1

Hello,
I am trying to create a table template. The API response is a JSON object. Manipulating the data using forEach in the column prints all the value in the same row instead of creating new rows. Please help me in building a table.
JSON format :
{
“Students”: [
{
“id”: 1,
“name”: “hsfdwf”,
“class”: 0,
“section”: “gvghg”,
“marks”: {
“Maths”: 100,
“English”: 89,
“Science”: 79,
},
“address”: “hgrye”
},
{
“id”: 2,
“name”: “hfghwef”,
“class”: 0,
“section”: “gvghg”,
“marks”: {
“Maths”: 100,
“English”: 89,
“Science”: 79,
},
“address”: “hyiue”
}
]
}
Thanks


(Subrahmanyam Donepudi) #2

Hi @arunp3,
I have used the sample JSON you provided and generated a table to display the details in it.
Executed the below steps:

  1. Created a dialog with a script node and message node in it. In the script node, I stored the sample JSON you provided us into a context variable.


  2. Configured the Message node at the section Report URL to generate a report.

  3. Referenced the path in which the data is available. (In your case, you could provide the path to response body of your service node (Say context.Service0001.response.body) where the service url is hit)
    image

  4. Configure the table to add the columns in it.
    image

  1. While executing the dialog, the report url will be present reportContext as shown below which you could use to present at the message node.

  2. Executed the dialog and used the url present inside the reportContext to generate the report. Below is a snip for table generated

Kr,
Subbu


(Siva L) #3

Hi @Subrahmanyam i am try to add Table template regular. Development side it working but after publish the bot its not working in browser using web sdk.


(Subrahmanyam Donepudi) #4

@rajinisiva93 Could you please provide the details on what issue you observed while accessing the template?