> ## Documentation Index
> Fetch the complete documentation index at: https://help.treble.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce AI Integration Features

> This guide shows you how to use the features of the Treble integration with Salesforce.

<img src="https://mintcdn.com/trebleai/eqEbD9Q-kJUYKDw2/images/salesforce-ai-1.png?fit=max&auto=format&n=eqEbD9Q-kJUYKDw2&q=85&s=6977c381c01a00ed48f4cad1e89705a4" alt="Salesforce AI Integration Features" width="2342" height="1352" data-path="images/salesforce-ai-1.png" />

The Salesforce integration with Treble allows you to interact with multiple entities in Salesforce CRM from your conversations in Treble. The available entities for interacting with the integration are: Lead, Contact, Company, Deal (Deal / Opportunity), and Pipeline.

With these entities, the integration tools allow you to execute different actions depending on the entity type. For Lead, Contact, Company, and Deal (Deal / Opportunity) you can create, update, delete, list, and query individual records. For Pipeline you can query one, list several, or delete.

# Available actions per entity

## Lead

| Action   | What can you do?                                                               |
| -------- | ------------------------------------------------------------------------------ |
| *Create* | Create a new lead in Salesforce CRM, including standard and custom properties. |
| *Update* | Update an existing lead, including standard and custom properties.             |
| *Remove* | Delete an existing lead in Salesforce CRM.                                     |
| *List*   | List multiple leads according to available filters.                            |
| *Get*    | Query a specific lead by its identifier.                                       |

## Contact

| Action   | What can you do?                                                                  |
| -------- | --------------------------------------------------------------------------------- |
| *Create* | Create a new contact in Salesforce CRM, including standard and custom properties. |
| *Update* | Update an existing contact, including standard and custom properties.             |
| *Remove* | Delete an existing contact in Salesforce CRM.                                     |
| *List*   | List multiple contacts according to available filters.                            |
| *Get*    | Query a specific contact by its identifier.                                       |

## Company

| Action   | What can you do?                                                                  |
| -------- | --------------------------------------------------------------------------------- |
| *Create* | Create a new company in Salesforce CRM, including standard and custom properties. |
| *Update* | Update an existing company, including standard and custom properties.             |
| *Remove* | Delete an existing company in Salesforce CRM.                                     |
| *List*   | List multiple companies according to available filters.                           |
| *Get*    | Query a specific company by its identifier.                                       |

## Deal (Deal / Opportunity)

| Action   | What can you do?                                                               |
| -------- | ------------------------------------------------------------------------------ |
| *Create* | Create a new deal in Salesforce CRM, including standard and custom properties. |
| *Update* | Update an existing deal, including standard and custom properties.             |
| *Remove* | Delete an existing deal in Salesforce CRM.                                     |
| *List*   | List multiple deals according to available filters.                            |
| *Get*    | Query a specific deal by its identifier.                                       |

## Pipeline

| Action   | What can you do?                               |
| -------- | ---------------------------------------------- |
| *Remove* | Delete an existing pipeline in Salesforce CRM. |
| *List*   | List multiple available pipelines.             |
| *Get*    | Query a specific pipeline by its identifier.   |

# How to use the Treble tools for Salesforce?

The Salesforce integration with Treble uses the "Automate complex tasks" AI assistant to execute the actions of the Treble tools for Salesforce. To do this, it is essential that you know how to use the "Automate complex tasks" AI assistant in Treble and how to configure the Treble tools for Salesforce.

If you need more information on how to use the "Automate complex tasks" AI assistant in Treble, you can consult the "Automate complex tasks" documentation in the following link:

<Card title="Automate complex tasks AI assistant in Treble" icon="robot" href="/en/docs/main-platform/ai-center/agents/reasoning-agent/overview">
  Learn how to use the "Automate complex tasks" AI assistant in Treble.
</Card>

# Configuring the Treble tools for Salesforce

To configure the Treble tools for Salesforce, follow these steps:

1. Go to the "AI Center" section in Treble.
2. Create a new AI agent.
3. Select the "Automate complex tasks" option.
4. In the "Tools" section, select the "Connected Applications" tool.
5. In the "Connected Applications" section, select the "Salesforce" application.
6. In the "Tools" section, select the "Salesforce" tool you want to configure.

<img src="https://mintcdn.com/trebleai/eqEbD9Q-kJUYKDw2/images/salesforce-ai-4.gif?s=8def4fa8ae8c9d8daa917956dc04a670" alt="Configuring the Treble tools for Salesforce" width="2338" height="1348" data-path="images/salesforce-ai-4.gif" />

This process is the same for all listed Treble tools for Salesforce. However, each tool has its own settings. We will explain each tool's settings below.

## Search Lead or Contact by Phone tool

Among the listed Treble tools for Salesforce, there is the "Search Lead or Contact by Phone" tool. This tool allows you to search for Leads or Contacts by phone. The tool automatically searches for the Lead or Contact in Salesforce CRM based on the WhatsApp phone number of the customer interacting with your AI assistant through a WhatsApp line connected to Treble. Your AI assistant does not need to ask the customer for their phone number — the tool will do it automatically.

<img src="https://mintcdn.com/trebleai/eqEbD9Q-kJUYKDw2/images/salesforce-ai-6.png?fit=max&auto=format&n=eqEbD9Q-kJUYKDw2&q=85&s=3f75ffd2e3cd6ba589c7e3916bd1df42" alt="Treble Search Lead or Contact by Phone tool" width="2344" height="1356" data-path="images/salesforce-ai-6.png" />

Click the option you want to configure — either search Lead or Contact by phone. Once you click, this tool has no further settings. In the next two steps click "Next Step" and finally click "Save Configuration". You will see the tool added inside your AI assistant's instructions.

<img src="https://mintcdn.com/trebleai/eqEbD9Q-kJUYKDw2/images/salesforce-ai-4.gif?s=8def4fa8ae8c9d8daa917956dc04a670" alt="Configuring the Treble tools for Salesforce" width="2338" height="1348" data-path="images/salesforce-ai-4.gif" />

### Phone format in Salesforce and properties

Treble uses the international phone format to search for Leads or Contacts in Salesforce CRM. For example, if the customer's phone is from the United States and the number is `(917) 555-0111`, Treble will search in Salesforce CRM as `+19175550111`. Treble will search within the `Phone` property in Salesforce CRM.

Keep in mind that, ultimately, the AI agent decides which format to use for the search. By default, the agent will try to search in international format. However, if phone numbers in your Salesforce CRM are not stored in international format, you can instruct the agent within its instructions (prompt) which format to use for the search.

Examples of instructions for the AI agent:

* Colombia: "When using the search Lead or Contact by phone tool, search first in Colombia's local format (for example, `3001234567`) and, if no results are found, try international format (`+573001234567`)."
* Argentina: "When searching by phone in Salesforce CRM, prioritize Argentina's local format (for example, `1151234567` or `3515123456`). If no matches, try international format (`+541151234567` or `+543515123456`)."
* Brazil: "To search for Leads or Contacts by phone, use Brazil's local format first (for example, `11987654321`). If no results, also try international format (`+5511987654321`)."

## Tools with Configuration Options

For the other tools, such as Create Lead, Update Contact, Create Company, Create Deal, Get a Pipeline, etc., these tools have configuration options. These configuration options allow you to interact with properties of those entities. These properties can be standard or custom. Let's look at some tool configuration examples.

### Example: Create Lead

The "Create Lead" tool allows you to create a new lead in Salesforce CRM. To configure this tool, follow these steps:

1. Enable the Salesforce tools view inside the "Tools" section of your AI assistant.
2. Click on the "Create CRM Lead" tool.
3. In this view, select the properties you want to configure for the lead. You can select standard or custom properties. In this example, we will select the properties "Name", "Emails", "Telephone", and "Status".

<img src="https://mintcdn.com/trebleai/eqEbD9Q-kJUYKDw2/images/salesforce-ai-8.gif?s=b9cd74c8ac83eeeffeb08c244afe6fa7" alt="Create Lead tool configuration" width="2334" height="1344" data-path="images/salesforce-ai-8.gif" />

4. Click "Next Step". In the "Parameters managed by AI Agent" view, select which properties you want the AI agent to complete dynamically during the conversation.

   When a property is marked as "managed by AI Agent", the agent will try to extract that value from the chat context (for example, name, email, or phone). If it cannot find the data clearly enough, it will ask the customer to provide it before executing the tool.

   For best results, define explicit instructions in the agent's prompt about which fields to collect and how. Recommended example: "When using the Create Lead tool, try to extract `Name`, `Emails`, and `Telephone` from the conversation context. If any is missing, ask the customer briefly and then create the Lead."

   In this view, mark only the variable fields. Fields you want to fix with a predefined value (for example, `Status = Lead`) can be left unselected here and configured in the next section.

   In this case we will select the properties "Name", "Emails", and "Telephone". (We leave the "Status" property unselected to configure it in the next section.)

<img src="https://mintcdn.com/trebleai/eqEbD9Q-kJUYKDw2/images/salesforce-ai-9.png?fit=max&auto=format&n=eqEbD9Q-kJUYKDw2&q=85&s=766ec45e35b6c1c4540c1382f110f4fb" alt="Create Lead tool configuration" width="2342" height="1352" data-path="images/salesforce-ai-9.png" />

5. In the next view, we will configure the fields where the Lead should be created with some predefined properties. For example, if you want the lead to be created with the status "Lead", write "Lead" in the "Status" field. You can configure this with multiple properties — that is, you can set several properties with a predefined value; the important thing is not to select them in the "Parameters managed by AI Agent" view.

<img src="https://mintcdn.com/trebleai/eqEbD9Q-kJUYKDw2/images/salesforce-ai-10.png?fit=max&auto=format&n=eqEbD9Q-kJUYKDw2&q=85&s=4c50a7f60094d45c5c3c8d0f551c7318" alt="Create Lead tool configuration" width="2346" height="1356" data-path="images/salesforce-ai-10.png" />

<Check>
  Congratulations! You have configured the Create Lead tool.
</Check>

# Final Conclusions

This configuration example for the **Create Lead** tool and its parameters applies identically to the other Salesforce tools and their configuration options. The logic is the same: define which properties are filled with data extracted by the AI agent, which are left as predefined values, and how the action is executed according to the entity. This applies to cases such as **List Pipeline**, **Get Contact**, **Update Deal**, **Create Company**, among others.
