Skip to main content

Table

A table is used to display a table in AI chat. In your AI Agent builder you should response in output key with this format:

output:

[
.... can be other ui types ...
{
"ui_type": "table",
"title": "Project Revenue Statistics",
"description": "Statistics by country",
"data": {
"columns": [
{
"key": "country",
"label": "Country"
},
{
"key": "users",
"label": "Users"
},
{
"key": "revenue",
"label": "Revenue ($)"
},
{
"key": "growth",
"label": "Growth %"
}
],
"rows": [
{
"country": "United States",
"users": 12500,
"revenue": 48000,
"growth": 12.4
},
{
"country": "Germany",
"users": 8300,
"revenue": 31000,
"growth": 9.1
},
{
"country": "India",
"users": 21400,
"revenue": 22000,
"growth": 18.7
}
]
}
},
... can be other ui types ...
]
tip

Title and description are optional. If you need to display only table data you can omit them.
Columns should be in data.columns field. Rows should be in data.rows field. In general, the table should be populated with data returned from your AI Agent Service. In most cases, this is done using a loop (e.g. for or foreach) to iterate over the results and build the response in the format described above.

Result:

Table UI Type