# Insert record

Inserting a record on your table means that you will create a new row on your table.

This means that you'll go from this:

| FullName | Email |
| -------- | ----- |
|          |       |

To that:

| FullName   | Email                  |
| ---------- | ---------------------- |
| **Agatha** | **<agatha@email.com>** |

## Insert a record

To insert a record on your table:

1. Make sure that you created a table with the appropriate structure. For this example, we will use a lead generation table that captures:&#x20;
   * **FullName:** Captures the lead's full name.
   * **Email:** Stores the lead's email address.

<figure><img src="/files/7v0dAtK1fFGlHxBUlZgd" alt=""><figcaption><p>An example of table for lead generation</p></figcaption></figure>

2. Make sure that you capture the relevant variables in your conversation. In our example, we capture the user name and email in [Collect input](/buildabot/flow-logic/dialog-state/user-input-bot-dialog.md) blocks. These are the variables that we want to add to our lead generation table, i.e. `customer_name` and `customer_email`.
3. [Add a Table operation](https://docs.chatlayer.ai/bot-answers/tables-beta/perform-operations-on-your-records#add-a-table-operation-to-your-flow) to your flow.

<figure><img src="/files/KsjyGouoDkq5D7AsbSHU" alt=""><figcaption><p>Add a Table operation to your flow.</p></figcaption></figure>

4. Select **Insert Record.**

<figure><img src="/files/vj1GQgq7IKnnLaGbDhaw" alt="" width="375"><figcaption><p>Select the Insert record table operation</p></figcaption></figure>

5. Select the table that you'd like to work on. For this example, we called our table **Lead generation**.

<figure><img src="/files/eNT17iyBQhNBHjt6wUDL" alt="" width="375"><figcaption><p>Select your table.</p></figcaption></figure>

6. To recall, our example lead generation table has 2 columns: `FullName` and `Email`. Under **Operation Config**, link the **FullName** field to be populated with the variable {`customer_name}.`
7. Do the same for **Email** and {customer\_email}.

<figure><img src="/files/yVYpcODy9t1I6jImxTwV" alt=""><figcaption><p>Insert a record to your table.</p></figcaption></figure>

8. Click **Save**.
9. Test your bot in the emulator. Run through your bot flow within the emulator to simulate the user experience and trigger the **Insert record** action.

<figure><img src="/files/ymwtdJWhFu29InT9FvEt" alt="" width="375"><figcaption></figcaption></figure>

10. After testing, navigate to your table to confirm that the lead's information has been accurately recorded and stored.

<figure><img src="/files/5kMrIRVaxzSGBUyszU9h" alt=""><figcaption></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/operate-on-your-records/insert-record.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.
