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

# Salesforce

> Create lead records in Salesforce using information collected during chatbot conversations.
The Salesforce integration allows you to send information collected by your WotNot chatbot directly to your Salesforce CRM. When a conversation reaches the Salesforce action block, WotNot can create a Lead record using the values collected and stored in bot variables.

This helps your sales team manage incoming leads in Salesforce without manually entering the information collected by the chatbot.

> [!NOTE]
>
> Available on the **Starter plan and above**

![Image](https://mintcdn.com/wotnot/ohFheQWjf85tIJpH/images/image-770.png?fit=max\&auto=format\&n=ohFheQWjf85tIJpH\&q=85\&s=5b0a30b9bb71dcf3e5b5dd7c92c2d362)

## What you can do

* **Create:** Creates a new Salesforce record using information collected during the conversation.
* **Fetch:** Retrieves information from Salesforce based on the configured criteria.
* **Update:** Updates an existing Salesforce record with values collected or generated during the conversation.

| **Action** | **Description** |
| :- | :- |
| **Create lead** | Create a new lead in Salesforce. |
| **Create contact** | Create a new contact in Salesforce. |
| **Create case** | Create a new case in Salesforce. |
| **Update lead** | Updates an existing lead in Salesforce. |
| **Update contact** | Updates an existing contact in Salesforce. |
| **Update case** | Updates an existing case in Salesforce. |
| **Fetch lead** | Fetches details of an existing lead. |
| **Fetch contact** | Fetches details of an existing contact. |
| **Fetch case** | Fetches details of an existing case. |

> [card] IMPORTANT
>
> The exact Salesforce objects and fields available for Create, Fetch, and Update depend on the configuration exposed by the WotNot Salesforce integration. Verify the available objects and fields in the Salesforce action block before documenting them as supported objects.

## Before you start

Before using the Salesforce integration, make sure:

* Your Salesforce organization has the required API access.
* You have the required Salesforce permissions to perform the selected operation.
* The Salesforce object you want to work with is available to your connected account.
* Any custom fields you want to use already exist in Salesforce.
* Required Salesforce fields are populated before creating or updating a record.
* Picklist values sent from WotNot match the values accepted by Salesforce.
* Any Salesforce validation rules or other organization-specific restrictions are satisfied.

> [!WARNING]
>
> Salesforce configuration can differ between organizations. Required fields, validation rules, permissions, picklists, duplicate rules, and available objects may vary depending on your Salesforce setup.

# Connecting Salesforce

1. Log in to your WotNot account.
2. Navigate to **App Market**.
3. Find and select **Salesforce**.
4. Open the configuration and click on Add Account
5. A Salesforce authentication window opens.
6. Select the Salesforce  account you want to connect.
7. Review and authorize the requested permissions.

## Using Salesforce in a flow

1. Open the **Bot Builder**.
2. Add the **Salesforce** action block.
3. Select your connected Salesforce account.
4. Configure the Salesforce object and action required for that operation.
5. Map WotNot variables to Salesforce fields where required.
6. Select lead id
7. Test the flow.
8. Deploy the bot after confirming that the Salesforce operation works as expected.

# Mapping fields

For operations that send data to Salesforce, map WotNot variables to the corresponding Salesforce fields.

| **WotNot variable** | **Salesforce field** | **Required** |
| - | - | - |
| `first_name` | First Name | No |
| `last_name` | Last Name | Yes |
| `company_name` | Company | Yes |
| `email_id` | Email | No |
| `phone_number` | Phone | No |

For Fetch operations, Salesforce values returned by the action can be stored or used in the subsequent flow according to the variables configured in the action.

### Required fields

When creating or updating a Salesforce record, make sure all required fields have valid values.

For a standard Salesforce Lead, **Last Name** and **Company** are required. Your Salesforce organization may have additional required fields configured by an administrator.

If a required value is empty, Salesforce may reject the operation.

## Troubleshooting

> [accordion] Fetch does not return a record
>
> Check the criteria configured for the Fetch operation.
>
> Make sure:
>
> * The search value is populated.
> * The value matches the expected Salesforce field.
> * The connected Salesforce account has permission to access the record.
> * The record exists in the selected Salesforce environment.
>
> If the record does not match the configured criteria, the Fetch operation may return no result.

> [accordion] Update does not modify the Salesforce record
>
> Make sure WotNot can identify the existing Salesforce record that you want to update.
>
> Then check:
>
> * The record exists.
> * The connected Salesforce user has update permission.
> * The fields being updated are accessible.
> * The new values satisfy Salesforce validation rules.
> * Required fields still contain valid values.

> [accordion] The Salesforce record was not created
>
> Check the required fields and Salesforce-side rules.
>
> A record can fail to create because of:
>
> * Empty required fields
>
> * Missing permissions
>
> * Validation rules
>
> * Invalid picklist values
>
> * Duplicate rules
>
> * Invalid field values
>
> * Salesforce API restrictions
>
> > [!NOTE]
> >
> > Salesforce validation rules and required-field configuration vary between customer organizations. A Salesforce operation can fail even when the WotNot integration itself is configured correctly.

> [accordion] A Salesforce validation rule is blocking the operation
>
> Salesforce administrators can configure validation rules that prevent records from being created or updated unless specific conditions are met.
>
> Check the Salesforce error message and review the validation rules configured for the relevant object.

> [accordion] The user does not have permission
>
> Ask your Salesforce administrator to verify that the connected Salesforce user has permission to:
>
> * Access the required object.
> * Read the required fields.
> * Create records when using Create.
> * Update records when using Update.
> * Read records when using Fetch.

# Disconnecting Salesforce

Disconnect Salesforce only when you no longer want your bots to use the connection.

**Steps to disconnect**

1. Go to your **Dashboard → App Market**.
2. Open the **Salesforce** integration setting
3. Click **Remove** next to your connected Salesforce account.

> [card] Disconnecting Salesforce may affect live bots
>
> * Live bot flows that reference the disconnected account may no longer be able to create Lead records. This can interrupt lead delivery to Salesforce until the connection is restored or the affected flows are updated.
> * Before disconnecting, review all dependent bots, update their configurations if necessary, and test lead creation before publishing changes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.