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

# Lead Capture in Salesforce CRM Using AI Agent

Use the **Lead Capture** dialog template to collect lead details conversationally and automatically create lead objects in Salesforce CRM.

## Overview

The process involves three steps:

1. [Link your Salesforce CRM account](#step-1-link-your-salesforce-crm-account)
2. [Install the Lead Capture template](#step-2-install-the-lead-capture-template-for-salesforce-crm)
3. [Train and test the dialog task](#step-3-train-and-test-the-dialog-task)

***

## Step 1: Link Your Salesforce CRM Account

1. Go to **Marketplace** in the left navigation and select **Salesforce CRM** integration.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/marketplace_salesforce.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=cc4a2b0a112c1fe9e317f6956c1a91e4" alt="Marketplace Salesforce" width="1906" height="871" data-path="ai-for-service/automation/how-tos/salesforce/images/marketplace_salesforce.png" />

2. Click **Install** at the top right. The **Instructions** tab opens.

3. Click the **Authenticate and Install** tab.

4. Under **Authorization Type**, select **Pre-authorize the Integration** and then **OAuth**.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/authorization.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=e74ca8d3bc45207c3875a3f3a9e9ea1c" alt="Authorization" width="1033" height="726" data-path="ai-for-service/automation/how-tos/salesforce/images/authorization.png" />

**System Authorization**

Use Kore.ai's preconfigured Salesforce app:

1. Select **System** and click **Authorize**. You are redirected to the Salesforce login page.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/system_authorise.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=d79dd521f85b45b0f9774dd52a17f34c" alt="System Authorization" width="1033" height="726" data-path="ai-for-service/automation/how-tos/salesforce/images/system_authorise.png" />

2. Enter your developer account credentials to connect your Salesforce account.

**Custom Authorization**

Create your own OAuth profile:

1. Select **Custom**, then click **Select Authorization** > **Create New**.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/custom_authorize.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=54fca0e13094aedf4d4a772549d8f41d" alt="Custom Authorization" width="1032" height="721" data-path="ai-for-service/automation/how-tos/salesforce/images/custom_authorize.png" />

2. Select **OAuth v2**. See [Setting Up Authorization Using OAuth v2](/ai-for-service/app-settings/dev-tools/bot-authorization/setting-up-authorization-using-oauth-v2).

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/OauthV2.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=bea68957ce02e06f76fb69ca0cab16aa" alt="OAuth v2" width="1186" height="911" data-path="ai-for-service/automation/how-tos/salesforce/images/OauthV2.png" />

3. Enter the following credentials:

   | Field                  | Description                        |
   | ---------------------- | ---------------------------------- |
   | Callback URL           | Your app's callback URL.           |
   | Identity Provider Name | Name for the provider.             |
   | Client ID              | OAuth client ID.                   |
   | Client Secret Key      | OAuth client secret.               |
   | Authorization URL      | Salesforce authorization endpoint. |
   | Token Request URL      | Token endpoint.                    |
   | Scope                  | Required OAuth scopes.             |
   | Refresh Token URL      | Token refresh endpoint.            |

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/new_authorization_mechanism.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=4f5942d004f260b8ecb593270907b291" alt="Authorization Mechanism" width="880" height="873" data-path="ai-for-service/automation/how-tos/salesforce/images/new_authorization_mechanism.png" />

4. Click **Save Auth**, select the new profile, and click **Authorize**. You are redirected to `login.salesforce.com`.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/salesforce_authorise.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=781a6939ff270a32063c091cf5b1e080" alt="Salesforce Authorize" width="1005" height="703" data-path="ai-for-service/automation/how-tos/salesforce/images/salesforce_authorise.png" />

5. Enter your login credentials. After successful authorization, click **Proceed**. The **Integration Installed Successfully** confirmation is displayed.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/installation_installed_successfully.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=fbc6d26a3c5ac04aba3f932ff1584403" alt="Installation Successful" width="1024" height="367" data-path="ai-for-service/automation/how-tos/salesforce/images/installation_installed_successfully.png" />

***

## Step 2: Install the Lead Capture Template for Salesforce CRM

1. Go to **Marketplace** and select the **Lead Capture for Salesforce CRM** dialog template.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/marketplace_leadcapture.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=c7afddfc3fb90af99cc08bd3a8b4dd07" alt="Marketplace Lead Capture" width="1908" height="585" data-path="ai-for-service/automation/how-tos/salesforce/images/marketplace_leadcapture.png" />

2. Click **Install**.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/lead_capture.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=22c9d4a40af02cb4d1f2d6f87eec66ee" alt="Lead Capture Install" width="1306" height="789" data-path="ai-for-service/automation/how-tos/salesforce/images/lead_capture.png" />

3. Fill in the dialog task details:

   | Field               | Description                         |
   | ------------------- | ----------------------------------- |
   | Name                | Name of the dialog.                 |
   | Description         | Description of the dialog.          |
   | Utterances          | Phrases that trigger this dialog.   |
   | Channel Experiences | Channel-specific behavior settings. |
   | Lead Capture Setup  | Fields and information to capture.  |

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/install_template.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=54e605acfccc85cd38467e012af7e878" alt="Install Template" width="1489" height="847" data-path="ai-for-service/automation/how-tos/salesforce/images/install_template.png" />

4. Click **Finish**. The dialog task is auto-created and listed under **Automation AI** > **Use Cases** > **Dialogs**.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/dialogs.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=05098418e01c77bad7384f4248458c43" alt="Dialogs" width="1888" height="544" data-path="ai-for-service/automation/how-tos/salesforce/images/dialogs.png" />

***

## Step 3: Train and Test the Dialog Task

1. Click the **Test** icon.

2. Select a conversation type (Voice or Chat).

3. Click **Train** to process untrained utterances.

4. Follow the prompts in the App console to create a lead.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/app_console.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=87f6fca8dc5e2571119fe861bf795792" alt="App Console" width="760" height="780" data-path="ai-for-service/automation/how-tos/salesforce/images/app_console.png" />

5. Enter lead details when prompted.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/lead_details.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=1846d1eaa3f9e524a4e7109503498b31" alt="Lead Details" width="508" height="715" data-path="ai-for-service/automation/how-tos/salesforce/images/lead_details.png" />

6. The lead is created in Salesforce CRM. To view it, log in to Salesforce, then go to **App Launcher** > **Marketing CRM Classic** > **Leads**.

   <img src="https://mintcdn.com/koreai/ZYZoyxWcsBnst_V0/ai-for-service/automation/how-tos/salesforce/images/salesforce.png?fit=max&auto=format&n=ZYZoyxWcsBnst_V0&q=85&s=d85af7facc2f231adb90fbf1b5443eb7" alt="Salesforce Leads" width="1884" height="594" data-path="ai-for-service/automation/how-tos/salesforce/images/salesforce.png" />

7. [Publish your app](/ai-for-service/deployment/publishing-app#publishing-an-agent) to make this capability available to end users.
