# Variáveis

Quando você cria uma mensagem com variáveis, o Focol a traduz para o valor apropriado.

Se enviarmos uma mensagem `Oi {{ contact.name }}, como posso ajudá-lo?,` então o Focol escolherá o nome do contato e enviará uma mensagem como`Oi João, como posso te ajudar?`. Isso permite que você envie mensagens personalizadas para o usuário final.

> Observação: o Focol oferece suporte a variáveis em resposta/macros/automação enlatadas.

Para usar uma variável, digite dois colchetes duplos {{ ao redigir uma nova mensagem ou criar uma resposta automática. As variáveis aparecerão e você poderá selecionar aquela que deseja usar.

A lista atual de variáveis de modelo são:

| Variable              | Description                       |
| --------------------- | --------------------------------- |
| conversation.id       | Versão numérica do ID da conversa |
| contact.id            | Versão numérica do ID do contato  |
| contact.name          | Nome completo do contato          |
| contact.first\_name   | Primeiro nome do contato          |
| contact.last\_name    | Sobrenome do contato              |
| contact.phone\_number | Número de telefone do contato     |
| agent.name            | Nome completo do Agente           |
| agent.first\_name     | Primeiro nome do agente           |
| agent.last\_name      | Sobrenome do Agente               |
| agent.phone\_number   | Telefone do Agente                |

E se a variável não existir?

Se você tentar enviar uma variável indefinida, o Focol mostrará um aviso.

Como adicionar texto alternativo?

Ao definir um texto alternativo, certifique-se de colocá-lo entre aspas simples.

`{{ contact.first_name || 'there'}}`


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.focol.com.br/contatos/variaveis.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.
