> 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/create-a-table-with-records.md).

# Crie uma tabela com registros

Aprenda como criar sua tabela e adicionar registros a ela.

{% hint style="info" %}
Alterações nas tabelas, como adicionar ou excluir uma tabela, serão aplicadas tanto aos ambientes ao vivo quanto aos de rascunho. No entanto, qualquer dado adicionado às tabelas será refletido apenas no ambiente em que os dados foram originalmente adicionados.

Se você quiser popular dados de um ambiente para outro, a melhor abordagem é exportar os dados do ambiente de origem e depois importá-los no ambiente de destino.
{% endhint %}

{% hint style="danger" %}
Observe que Tabelas não podem ser exportadas em[ exportação do bot](/chatlayer-documentation-pt-br/navegacao/settings/import-export.md) ainda.
{% endhint %}

\
Vamos imaginar um cenário em que um bot está ajudando os usuários a reservar sua aula favorita de yoga ou Zumba. Você quer usar a tabela para verificar a aula disponível e, em seguida, ajudar os clientes a reservar sua aula favorita. Siga estas etapas para começar a usar Tabela.

## Criar uma tabela

Para adicionar uma tabela às suas Tabelas:

1. Navegue até a **Tabelas** seção no menu principal.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FUOShkF7DsoXIDsha7jUj%2FScreenshot%202024-03-13%20at%2017.20.40.png?alt=media&amp;token=603db601-a610-4218-99d3-0b6dc1de3c77" alt="" width="122"><figcaption><p>Tabelas no menu lateral</p></figcaption></figure>

2. Clique no **+** botão no topo da tela.
3. Dê à tabela um nome descritivo e forneça uma breve explicação sobre sua finalidade. Neste exemplo, nossa tabela serve para armazenar informações sobre as datas, nomes e horários de um sistema de agendamento de aulas de yoga/Zumba.
4. Defina as colunas da sua tabela. Especifique o nome de cada coluna e selecione o [tipo de variável para sua coluna](/chatlayer-documentation-pt-br/navegacao/tables/column-types.md). Para este exemplo, teremos apenas colunas de texto para:
   * `nomeDaAula`
   * `classDay`
   * `classTime`
   * `professorDaAula`
   * `estáReservado`

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2Fipdp7pYJgOEaLgnmB9XM%2FScreenshot%202024-03-13%20at%2017.33.54.png?alt=media&amp;token=f84ca106-a180-4360-92a0-033fdbe2778e" alt="" width="375"><figcaption><p>Crie uma tabela e adicione colunas a ela.</p></figcaption></figure>

5. Clique em **Criar**.

Saiba mais sobre os tipos de coluna no artigo dedicado 👇

{% content-ref url="/pages/71459e13998d458a0f03e1ef5c923a3643b99af0" %}
[Tipos de coluna](/chatlayer-documentation-pt-br/navegacao/tables/column-types.md)
{% endcontent-ref %}

Você criou uma tabela com sucesso! Por enquanto, ela ainda está vazia.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FiBXM8ABvfXC0OfpYCC1c%2FScreenshot%202024-03-13%20at%2017.52.36.png?alt=media&amp;token=732438a3-66b9-4a79-90c1-2f1d3d979df1" alt=""><figcaption><p>Tabela vazia criada.</p></figcaption></figure>

## Excluir uma tabela

1. Clique no botão de três pontos

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FLACKk7hDu6LTAqKvPRjq%2FScreenshot%202024-07-01%20at%2022.06.11.png?alt=media&amp;token=7324089c-2806-416a-bf82-2514763a5db3" alt="" width="375"><figcaption><p>Selecione excluir</p></figcaption></figure>

2. Selecione **Excluir**
3. Confirmar **Excluir**<br>

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FitzqxcNOS7ZxIDOPxA4m%2FScreenshot%202024-07-01%20at%2022.07.19.png?alt=media&amp;token=ea7f6128-a895-41b9-b54b-24e977b41f5f" alt=""><figcaption><p>Confirmação em modal antes de excluir uma tabela</p></figcaption></figure>

\
\
Vamos agora adicionar registros à tabela.

## Criar um novo registro

Um registro é uma linha de dados na sua tabela.

Para popular sua tabela com dados, você pode:

* [Inserir registro manualmente](#insert-record-manually).
* [Importar dados](#import-record) que já existem em outro lugar.

### Adicionar um novo registro manualmente

1. Na sua tabela, clique em **Inserir registro** no canto superior direito da sua tela.
2. Preencha o valor de cada coluna.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F2Ic4IygRWXuxP6byJTIE%2FScreenshot%202024-03-13%20at%2017.55.05.png?alt=media&amp;token=6c01c884-7265-4e3a-83c8-df8a97d3aee4" alt="" width="375"><figcaption><p>Insira um registro na sua tabela manualmente.</p></figcaption></figure>

3. Clique em **Adicionar**.

Agora você pode ver seu registro dentro da tabela!

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FLZm2PeDkZekXqMZI7iU5%2FScreenshot%202024-03-13%20at%2017.58.29.png?alt=media&amp;token=d724f935-a5e1-495a-90fb-7c990660e172" alt=""><figcaption><p>Tabela preenchida com um registro.</p></figcaption></figure>

### Editar registro

1. Clique no botão de três pontos no lado esquerdo da tabela
2. Selecione **Editar**
3. Editar registros<br>

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FmY9E2j77H7XEQo3N71K4%2FScreenshot%202024-07-01%20at%2022.03.46.png?alt=media&amp;token=6ba127a5-c47c-427a-bbeb-726ea5afbd16" alt=""><figcaption><p>Editar registros</p></figcaption></figure>

4. Clique em **Salvar**

### Importar um registro

{% hint style="info" %}
Para importar mais de 100 registros, é recomendável usar uma API em vez da importação manual de dados. Encontre a documentação [aqui](/chatlayer-documentation-pt-br/navegacao/tables/api.md).
{% endhint %}

1. Na sua tabela, clique na seta ao lado do **Inserir registro** botão.
2. Selecione **Importar dados**.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FR0EJw8e0GwznDF4BZvAv%2FScreenshot%202024-03-13%20at%2018.02.29.png?alt=media&amp;token=cdd165b6-4e0d-4230-a57e-4a875c674435" alt="" width="296"><figcaption><p>botão Importar dados</p></figcaption></figure>

3. Arraste e solte um arquivo CSV.
4. Se seus dados forem incompatíveis, você verá um alerta vermelho ao lado de **Pré-visualizar dados a serem importados**. Clique nesta seção.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FnyreoFl09HBxuRfRsXtf%2FScreenshot%202024-03-13%20at%2018.05.44.png?alt=media&amp;token=2bb2e186-e0df-4750-a543-90f7ffe13ad1" alt="" width="375"><figcaption><p>Verifique se seus dados são válidos antes de importar registros para sua tabela.</p></figcaption></figure>

5. Os detalhes se expandem para que você possa revisar os problemas que precisam ser resolvidos. Neste exemplo, o problema é que temos algumas incompatibilidades nos cabeçalhos das colunas.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FaJJcYIO70AmIIdJUIVM2%2FScreenshot%202024-03-13%20at%2018.07.50.png?alt=media&amp;token=be62f0d7-c848-42f7-8dc3-bcf592cbe52e" alt="" width="375"><figcaption><p>Revise os dados antes que eles sejam importados para sua tabela.</p></figcaption></figure>

6. Depois de identificar todos os problemas, vá para **Configurar dados de importação** para resolver esse&#x73;**.** Neste exemplo, como foi mencionado que algumas colunas não estão presentes na tabela, desmarque as colunas que não devem ser importadas.

{% hint style="info" %}
As colunas selecionadas em verde serão importadas, enquanto as brancas não serão importadas.
{% endhint %}

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FOuQQOO4LhOH8odOCf08I%2FScreenshot%202024-03-13%20at%2018.11.58.png?alt=media&amp;token=ae38543d-a7c1-44d6-b9e3-8e9edecc8fc4" alt="" width="375"><figcaption><p>Desmarcando colunas a serem importadas</p></figcaption></figure>

7. Depois de resolver os problemas, a **Dados incompatíveis** etiqueta desaparecerá, indicando que os dados agora estão prontos para importação.
8. Clique em **Importar** como a etapa final.

Sua tabela agora está preenchida com os dados que estavam no seu arquivo .csv!

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FH55MmCvtYq62rVpPTk1y%2FScreenshot%202024-03-13%20at%2018.14.04.png?alt=media&amp;token=b91339b7-b144-4519-b45c-8d651dc4f569" alt=""><figcaption><p>Tabela preenchida com uma importação de CSV.</p></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/create-a-table-with-records.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.
