> 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/delete-record.md).

# Excluir registro

Aprenda como usar a operação de excluir registro na sua tabela usando um exemplo de fluxo de opt-out.

Excluir um registro na sua tabela significa que você excluirá uma linha na sua tabela.

Isso significa que você vai sair deste:

| nome   | email\_address    | is\_susbcribed |
| ------ | ----------------- | -------------- |
| Agatha | <agatha@test.com> | TRUE           |

Para isso:<br>

| nome | email\_address | is\_susbcribed |
| ---- | -------------- | -------------- |
|      |                |                |

Para excluir um registro da sua tabela:

1. Certifique-se de já ter uma tabela preenchida. Para este exemplo, usaremos uma tabela de opt-in/opt-out que captura:
   * **nome**: Captura o nome do cliente.
   * **email\_address**: Armazena o endereço de e-mail do cliente.
   * **is\_subscribed**: Armazena o consentimento do cliente para ser inscrito em uma campanha.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2Fr0GbeDuxJbVJs1Ag7A3j%2FScreenshot%202024-04-19%20at%2008.43.35.png?alt=media&amp;token=42bd6c8f-a028-4d88-b123-50f9f2743105" alt=""><figcaption><p>Um exemplo de tabela de opt-in/opt-out.</p></figcaption></figure>

2. Certifique-se de capturar as variáveis relevantes na sua conversa. No nosso exemplo, capturamos `{userName}` nos blocos Coletar entrada. Esta é a variável que usaremos como filtro para direcionar determinada linha a ser excluída.
3. [Adicionar uma operação de Tabela](https://docs.chatlayer.ai/bot-answers/tables-beta/operate-on-your-records#add-a-table-operation-to-your-flow) no seu fluxo.
4. Selecione **Excluir registro.**
5. Selecione a tabela na qual você gostaria de trabalhar. Para este exemplo, chamamos nossa tabela de **Assinaturas.**
6. Clique em **+ Adicionar filtro** para definir um critério de seleção. Para este exemplo, filtramos observando a coluna 'name'. Se o nome for igual a `{userName}`, isso significa que a linha será excluída assim que o fluxo de opt-out for acionado.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2Fc4xSY8ZH5629hSNILtZX%2FScreenshot%202024-04-19%20at%2008.48.10.png?alt=media&amp;token=c9936b00-c9ec-483b-a3f7-71370262cb6b" alt=""><figcaption><p>Excluir um registro da sua tabela.</p></figcaption></figure>

7. Clique em **Salvar**.
8. Adicione um **Mensagem** bloco como um Go To para informar ao cliente que ele foi removido com sucesso da assinatura.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FfzQmRJvPgAVKOD66oJIu%2FScreenshot%202024-04-19%20at%2008.58.21.png?alt=media&amp;token=27c63034-c35e-4884-8690-cad6a9176bdb" alt=""><figcaption><p>Exemplo de fluxo de opt-out.</p></figcaption></figure>

9. É crucial verificar a funcionalidade da sua operação Excluir registro para garantir que a linha correta seja excluída. Teste seu bot no emulador. Percorra o fluxo do seu bot no emulador para simular a experiência do usuário e acionar o **Excluir registro** acionada.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FEDRCriNwqhGVXnLfvLEP%2FScreenshot%202024-04-19%20at%2009.20.37.png?alt=media&amp;token=5b6863a4-3310-49f4-8572-63fd9f64ac1b" alt="" width="375"><figcaption><p>Teste o seu fluxo.</p></figcaption></figure>

10. Abra sua tabela e verifique se o bot excluiu a linha correta.

<figure><img src="https://181262846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2F5LdSObBnVCihaCvSLx8M%2FScreenshot%202024-04-19%20at%2009.22.42.png?alt=media&amp;token=5d591242-7f0b-45fc-99d4-fafd310ef84f" alt=""><figcaption><p>Verifique se o bot excluiu o fluxo correto.</p></figcaption></figure>

{% hint style="success" %}
Procurando um template de bot rápido e fácil para brincar com Tabelas? O [bot Gym](https://docs.chatlayer.ai/tutorials/bot-templates/gym) é 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/delete-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.
