# Tables (beta)

## Overview (Beta version)&#x20;

With Hala, you can include the table in the response. It can be useful when you are making an API request to external application, and then you want to represent the API response in the table view for the user. Also, you can use tables with mockup data, if you need to represent the information with columns and lines.

For example:&#x20;

![](/files/-LrE5WKmT_dY1zQ_uMvU)

## Adding the tables in Expert mode

You can use the expert mode to add the tables. The expert mode becomes available by pressing the button next to the word "Output." &#x20;

<div align="left"><img src="/files/-LrDaVc-cu_vp0TTNdz0" alt="Access the Expert mode"></div>

Here is the JSON format for the tables that generated based on the API response:&#x20;

```javascript
[
 {
        "type": "smart-table",
        "view": "horizontal",
        "name":"Example table",
        "filters": {
          "Country": [
            "Estonia"
          ]
        },
        "sourceData": "{{context.responseFromAPI}}",
        "requiredFields": [
          "Country",
          "Company",
          "Address",
          "Phone number",
          "Email"
        ],
        "transformFromDb": true
}
]
```

Example for the table with mockup data:

```javascript
{
            "type": "smart-table",
            "view": "horizontal",
            "name": "Table name",
            "transformFromDb": false,
            "sourceData": [{
                "Country": "Estonia",
                "Company": "Hala Digital OU",
                "Address": "Erika 14",
                "Phone number": "+37259823235",
                "Email": "rudchuk@hala.ai"
            }, {
                "Country": "Latvia",
                "Company": "Hala Digital SIA",
                "Address": "Puces 10",
                "Phone number": "+37259823235",
                "Email": "support@hala.ai"
            }]
        }
```

The views of the table in the chat based on mockup data above:

![](/files/-Ls0ojicPO-SQkY-B83R)

The following table describes the parameters that can be used to build the table:

| Parameter         | Type    | Description                                                                                                                                                                                                                                     |
| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`            | string  | String value, specifying the format.                                                                                                                                                                                                            |
| `view`            | string  | View of the tables. `horizontal` - columns are displayed horizontally. `vertical` - columns are displayed vertically                                                                                                                            |
| `name`            | string  | Optional. The name of your table that is displaying for the user in output.                                                                                                                                                                     |
| `filters`         | array   | Optional. Array with Objects. Each object represents a filter. The key of the Object denotes the field that should be filtered, and the Array of Strings represents the criteria.                                                               |
| `sourceData`      | array   | Array with all the data records to be displayed in the Table. It can be described as `{{context.context_name}}` or with the mockup data.                                                                                                        |
| `requiredFields`  | array   | Optional. Array with String values representing the keys that the table should use to populate the columns. If it is empty, the SmartTable will use the first five fields in the "sourceData" object.                                           |
| `transformFromDb` | boolean | A boolean value indicating if the keys in the "sourceData" objects should be replaced with longer and more explicit ones from the database (API response), if set `false`, the keys will be shown in the columns of the table just as they are. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hala.ai/key-concepts/skills-kit/output-in-nodes/output-tables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
