> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/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.

   ![Marketplace Salesforce](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)

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**.

   ![Authorization](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)

**System Authorization**

Use Kore.ai's preconfigured Salesforce app:

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

   ![System Authorization](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)

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**.

   ![Custom Authorization](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)

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

   ![OAuth v2](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)

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. |

   ![Authorization Mechanism](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)

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

   ![Salesforce Authorize](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)

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

   ![Installation Successful](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)

***

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

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

   ![Marketplace Lead Capture](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)

2. Click **Install**.

   ![Lead Capture Install](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)

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. |

   ![Install Template](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)

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

   ![Dialogs](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)

***

## 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.

   ![App Console](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)

5. Enter lead details when prompted.

   ![Lead Details](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)

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

   ![Salesforce Leads](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)

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


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