# Create a table with records

{% hint style="info" %}
Changes to the tables, such as adding or deleting a table, will be applied to both the live and draft environments. However, any data added to the tables will only be reflected in the environment where the data was originally added.

If you wish to populate data from one environment to another, the best approach is to export the data from the source environment and then import it into the target environment.
{% endhint %}

{% hint style="danger" %}
Please note that Tables cannot be exported at[ bot export](/navigation/settings/import-export.md) yet.
{% endhint %}

\
Let's imagine a scenario where a bot is helping users book their favorite yoga or Zumba class. You want to use table to check available class and then help customers to book their favourite class. Follow these steps to get started using Table.&#x20;

## Create a table&#x20;

To add a table to your Tables:

1. Navigate to the **Tables** section in the main menu.

<figure><img src="/files/jjVveV11RiXsIUlaO5ii" alt="" width="122"><figcaption><p>Tables on the side bar menu </p></figcaption></figure>

2. Click the **+** button at the top of the screen.
3. Give the table a descriptive name and provide a brief explanation of its purpose. In this example, our table serves to store info about the dates, names and times of a yoga/zumba class booking system.
4. Define your table columns. Specify the name of each column and select the appropriate [type of variable for your column](/navigation/tables/column-types.md).  For this example, we'll only have text columns for:
   * `className`
   * `classDay`
   * `classTime`
   * `classTeacher`
   * `isBooked`

<figure><img src="/files/TnMSKaLBpVlLKeiXOTIe" alt="" width="375"><figcaption><p>Create a Table and give it columns.</p></figcaption></figure>

5. Click **Create**.

Learn more about the columns types in the dedicated article 👇

{% content-ref url="/pages/5UP88IHHsXprtXiyGddv" %}
[Column types](/navigation/tables/column-types.md)
{% endcontent-ref %}

You've successfully created a table! For now, it's still empty.

<figure><img src="/files/NiSWdmWP5HoD8i1U9or4" alt=""><figcaption><p>Created empty Table.</p></figcaption></figure>

## Delete a table

1. Click the three dots button&#x20;

<figure><img src="/files/xgybCBTQxjMR8fZJScXa" alt="" width="375"><figcaption><p>Select delete</p></figcaption></figure>

2. Select **Delete**
3. Confirm **Delete**<br>

<figure><img src="/files/SdMsmoBypYXqIb8QJK27" alt=""><figcaption><p>Modal confirmation before deleting a table</p></figcaption></figure>

\
\
Let's now add records to the Table.

## Create a new record

A record is a line of data on your table.

To populate your table with data, you can either:

* [Insert record manually](#insert-record-manually).
* [Import data](#import-record) that already lives somewhere else.

### Add a new record manually&#x20;

1. From your table, click on **Insert record** at the top-right corner of your screen.
2. Fill the value for each column.

<figure><img src="/files/HzqdILF8H6Fqj6uqYBkd" alt="" width="375"><figcaption><p>Insert a record to your table manually.</p></figcaption></figure>

3. Click **Add**.&#x20;

You can now see your record inside the table!

<figure><img src="/files/REChoeZBJg76gsy9Ipnp" alt=""><figcaption><p>Table filled with one record.</p></figcaption></figure>

### Edit record&#x20;

1. Click the three dots button on the left side of the table
2. Select **Edit**&#x20;
3. Edit records<br>

<figure><img src="/files/WR8lFwytn7gdNq6Lx3lE" alt=""><figcaption><p>Edit records</p></figcaption></figure>

4. Click **Save**

### Import a record &#x20;

{% hint style="info" %}
For importing more than 100 records, using an API is recommended over manual data import. Find the documentation [here](/navigation/tables/api.md).
{% endhint %}

1. From your table, click on the arrow next to the **Insert record** button.&#x20;
2. Select **Import data**.

<figure><img src="/files/Q03jVyEgHQeP9fy0YbbS" alt="" width="296"><figcaption><p>Import data button</p></figcaption></figure>

3. Drag and drop a CSV file.&#x20;
4. If your data is incompatible, you will get a red alert next to **Preview data to be imported**. Click on this section.

<figure><img src="/files/QJGD2P15RIs3UwfObU0U" alt="" width="375"><figcaption><p>Check that your data is valid before importing records to your table.</p></figcaption></figure>

5. The details unfold so that you can review the issues that need to be solved. In this example, the problem is that we have some columns headers incompatibilities.&#x20;

<figure><img src="/files/89M0u6UTzvnd06CEHu3L" alt="" width="375"><figcaption><p>Review data before it's imported to your table.</p></figcaption></figure>

6. After figuring out all the issues, go to **Configure import data** to solve thos&#x65;**.** In this example, as it mentioned that some columns are not present in the table, deselect the columns that shouldn't be imported.&#x20;

{% hint style="info" %}
The columns selected in green will be imported, whereas the white ones won't be imported.
{% endhint %}

<figure><img src="/files/aCWLQCgucb3owPrKCtol" alt="" width="375"><figcaption><p>Deselecting columns to be imported</p></figcaption></figure>

7. Once you have resolved the issues, the **Data incompatible** tag will disappear, indicating that the data is now ready for import.
8. Click **Import** as the last step.&#x20;

Your table is now filled with the data that was in your .csv file!

<figure><img src="/files/w15IV7yp4iCsBaLVGayy" alt=""><figcaption><p>Table filled with a CSV importation. </p></figcaption></figure>

***

{% hint style="success" %}
Looking for a quick and easy bot template to play with Tables? The [Gym bot](/start-quickly/bot-templates/gym.md) is a representative use case.
{% endhint %}


---

# 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.chatlayer.ai/navigation/tables/create-a-table-with-records.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.
