> For the complete documentation index, see [llms.txt](https://docs.chatlayer.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatlayer.ai/chatlayer-documentation-pt-br/navegacao/tables/operate-on-your-records/insert-record.md).

# Inserir registro

Aprenda como usar a operação de inserir registro na sua tabela usando um exemplo de fluxo de geração de leads.

Inserir um registro na sua tabela significa que você criará uma nova linha na sua tabela.

Isso significa que você vai sair deste:

| Nome completo | E-mail |
| ------------- | ------ |
|               |        |

Para isso:

| Nome completo | E-mail                 |
| ------------- | ---------------------- |
| **Agatha**    | **<agatha@email.com>** |

## Insira um registro

Para inserir um registro na sua tabela:

1. Certifique-se de ter criado uma tabela com a estrutura apropriada. Para este exemplo, usaremos uma tabela de geração de leads que captura:
   * **Nome completo:** Captura o nome completo do lead.
   * **E-mail:** Armazena o endereço de e-mail do lead.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FVuz4WAtZVuDYTig8SYpl%2FScreenshot%202024-03-13%20at%2018.28.31.png?alt=media&amp;token=08f97c43-a634-43f8-8e00-e223f7593b19" alt=""><figcaption><p>Um exemplo de tabela para geração de leads</p></figcaption></figure>

2. Certifique-se de capturar as variáveis relevantes na sua conversa. No nosso exemplo, capturamos o nome do usuário e o e-mail em [Coletar entrada](/chatlayer-documentation-pt-br/buildabot/flow-logic/dialog-state/user-input-bot-dialog.md) blocos. Essas são as variáveis que queremos adicionar à nossa tabela de geração de leads, ou seja, `customer_name` e `customer_email`.
3. [Adicionar uma operação de Tabela](https://docs.chatlayer.ai/bot-answers/tables-beta/perform-operations-on-your-records#add-a-table-operation-to-your-flow) no seu fluxo.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FvBIZBHMPVcKz0U9sbJNK%2FScreenshot%202024-03-13%20at%2018.29.56.png?alt=media&amp;token=c7a4c1e9-e681-44dc-9b06-3789745e0fb2" alt=""><figcaption><p>Adicione uma operação de Tabela ao seu fluxo.</p></figcaption></figure>

4. Selecione **Inserir registro.**

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FXi2mBcrnO2QG2n6Snwak%2FScreenshot%202024-03-12%20at%2021.17.29.png?alt=media&amp;token=e500a3c7-ffc4-47f0-b5cb-98dbeba02343" alt="" width="375"><figcaption><p>Selecione a operação de tabela Inserir registro</p></figcaption></figure>

5. Selecione a tabela na qual você gostaria de trabalhar. Para este exemplo, chamamos nossa tabela de **Geração de leads**.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FxsReGIIKomUkqDqKJ6s6%2FScreenshot%202024-03-13%20at%2018.32.00.png?alt=media&amp;token=6ca04533-fd5b-4926-89af-18838c7bdf7f" alt="" width="375"><figcaption><p>Selecione sua tabela.</p></figcaption></figure>

6. Só para relembrar, nossa tabela de geração de leads de exemplo tem 2 colunas: `Nome completo` e `E-mail`. Em **Configuração da operação**, vincule o **Nome completo** campo a ser preenchido com a variável {`customer_name}.`
7. Faça o mesmo para **E-mail** e {customer\_email}.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FwrMtzRIzhH4T7s57KrAv%2FScreenshot%202024-03-15%20at%2011.42.05.png?alt=media&amp;token=94bcdf91-b91d-499f-97c2-9e9f4cb41f92" alt=""><figcaption><p>Insira um registro na sua tabela.</p></figcaption></figure>

8. Clique em **Salvar**.
9. Teste seu bot no emulador. Percorra o fluxo do seu bot no emulador para simular a experiência do usuário e acionar o **Inserir registro** acionada.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FEB0PZ6MMJ7ZKFMMJ4YUP%2FScreenshot%202024-03-18%20at%2012.16.21.png?alt=media&amp;token=6a9291b8-b7f2-4a06-842c-afd336e802fb" alt="" width="375"><figcaption></figcaption></figure>

10. Após o teste, navegue até sua tabela para confirmar que as informações do lead foram registradas e armazenadas corretamente.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FiqDGVORDonGOGv19HHhl%2FScreenshot%202024-03-18%20at%2012.16.56.png?alt=media&amp;token=66d8cbaf-9d08-4df9-a2c2-703ab6eeebd1" alt=""><figcaption></figcaption></figure>

***

{% hint style="success" %}
Procurando um template de bot rápido e fácil para brincar com Tabelas? O [bot Gym](/chatlayer-documentation-pt-br/comece-rapido/bot-templates/gym.md) é um caso de uso representativo.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chatlayer.ai/chatlayer-documentation-pt-br/navegacao/tables/operate-on-your-records/insert-record.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
