> 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/integrateandcode/app-integrations/salesforce.md).

# Salesforce

Esse Salesforce permitirá que você execute as seguintes ações:

* Obter contato
* Criar contato
* Criar conta
* Recuperar entidade (tipo Contato)
* Criar entidade (tipo Caso)
* Consultar SOQL - mais informações em [documentação do Salesforce](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm)

## Adicionar Salesforce em um bloco de ação

Para adicionar um passo do Salesforce:

{% stepper %}
{% step %}
A partir de um [**Ação**](/chatlayer-documentation-pt-br/buildabot/flow-logic/dialog-state/action-bot-dialog.md) bloco, vá para a **Integrações** aba e pesquise por **Salesforce.**

<figure><img src="/files/e5c3ca17cf0282f5990232c30fe4472b5709b042" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}
Selecione uma ação na lista suspensa.

<figure><img src="/files/da2949c027ca0555dd5cdee31dc99b890bc16349" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}
A próxima opção que aparecerá é a de **Conectar uma conta** no Salesforce. Clique no botão e um pop-up aparecerá para que você adicione nome de usuário e senha para conectar:

<figure><img src="/files/384b21fc94af268a738a9cfe93fba3abb5fdee1f" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Na ação Obter contato, os nomes dos campos de consulta são ID, nome, e-mail, telefone e celular.

<figure><img src="/files/3dfbc345cf235bfb998573aa6a5dc1ab037acf39" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}
Para criação de Contato, os campos e-mail, nome, sobrenome, telefone, celular, descrição e país estão disponíveis:

<figure><img src="/files/195ffd49a02134f958fffd824fae743c9a2e8c6f" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}
A resposta da requisição feita ao Salesforce será salva em uma variável: `apps.salesforce.createContact`

<figure><img src="/files/ed6c82a7f54d762aa233660d568fb3bfed0526cc" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}
A ação Criar conta permitirá que você adicione nome, site, telefone, país de cobrança e descrição à conta que será criada através do chatbot. A resposta do Salesforce será salva na variável `apps.salesforce.createAccount`

<figure><img src="/files/c24cbae4cbf89b81e966a3d9d490de2951b9da76" alt=""><figcaption></figcaption></figure>

{% endstep %}

{% step %}
Para a ação Consultar SOQL, uma sugestão aparecerá: `SELECT Id, name FROM Contact WHERE Name LIKE '{internal.user.id}'` mas você pode editar livremente com sua própria consulta. Mais informações em [documentação do Salesforce](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm).

<figure><img src="/files/f6d7ae3d513ede7e89d54513dc0dac0d18502ed1" alt=""><figcaption></figcaption></figure>

{% endstep %}
{% endstepper %}

Agora você está pronto para fornecer o melhor suporte ao cliente com o Chatlayer e o Salesforce!


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.chatlayer.ai/chatlayer-documentation-pt-br/integrateandcode/app-integrations/salesforce.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
