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

# Using the Salesforce CRM Action Templates

<Badge icon="arrow-left" color="gray">[Back to Actions Integrations](/ai-for-service/integrations/overview#actions)</Badge>

Use prebuilt Salesforce CRM action templates to auto-create dialog tasks for managing leads and opportunities.

**To access templates:**

1. Go to **Automation AI** > **Use Cases** > **Dialogs** and click **Create a Dialog Task**.

2. Under **Integration**, select **Salesforce**.

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img2.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=55441a8a76a87ae02e262fb38251bb15" alt="Integration - Salesforce" width="1196" height="908" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img2.png" />

3. If no integration is configured, click **Explore Integrations** to set one up. See [Actions Overview](/ai-for-service/integrations/overview#actions).

***

## Supported Actions

| Task                  | Description                              | Method |
| --------------------- | ---------------------------------------- | ------ |
| Create a Lead         | Creates a new marketing lead in the CRM. | POST   |
| Create an Opportunity | Creates a new opportunity in the CRM.    | POST   |
| Update a Lead         | Updates the lead with changes.           | PATCH  |
| View a Lead By ID     | Retrieves the lead details.              | GET    |
| List All Leads        | Retrieves all leads from the CRM.        | GET    |
| Search Leads          | Searches all leads that match a keyword. | GET    |
| Delete a Lead         | Deletes a lead.                          | DELETE |

***

### Create a Lead

1. Install the template from [Salesforce Action Templates](/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Create a Lead** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img4.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=e9a55da207839a8869395a02a6e96d15" alt="createLeadService bot action component properties" width="685" height="699" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img4.png" />

   * **Createlead** - User intent to create a lead.

   * **firstName**, **lastName**, **companyName** - Entity nodes for lead details.

   * **CreateLeadService** - Bot action service to create a lead. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img5.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=331185063a470e04e2a8b9dded1692b7" alt="Edit request" width="1919" height="877" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img5.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "attributes": {"type": "Lead"},
       "LastName": "Doe",
       "FirstName": "John",
       "Company": "ABC",
       "MobilePhone": "93445667xx",
       "Status": "Open - Not Contacted",
       "OwnerId": "0055g00000ECRvPAAX",
       "IsConverted": false
     }
     ```

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img6.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=38f11ecac3909495ecb8ef1e094b2fb1" alt="Add response" width="1014" height="448" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img6.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "00Q5g00000DZ0d4EAD",
       "success": true,
       "errors": []
     }
     ```

   * **subDomainService** - Bot action service to fetch subdomain.

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img7.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=2059f90f025313585c361eb15a778c23" alt="subDomainService bot action component properties" width="677" height="654" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img7.png" />

   * **createLeadMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img8.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=70b121a996b3841935918a12b7e8c4a8" alt="VA prompts to create a lead" width="563" height="851" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img8.png" />

4. Enter lead details when prompted:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img9.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=26a4428773e045ca3a9f1c2789d4d90e" alt="Enter lead details" width="554" height="853" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img9.png" />

5. The new lead is created in Salesforce CRM:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img10.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=0645eb219e46cf82b0fb79ad44e9468c" alt="New lead created" width="481" height="594" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img10.png" />

6. Click **View Lead** to see lead details:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img11.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=34df78cff8bc8322e5189c89539d92ff" alt="View lead details" width="1038" height="547" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img11.png" />

***

### Update a Lead

1. Install the template from [Salesforce Action Templates](/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Update a Lead** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img12.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=1efef7b27307851aee386197018683bd" alt="Update a Lead dialog task is added" width="1712" height="780" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img12.png" />

   * **Update lead** - User intent to update a lead.

   * **Id**, **AskOptions**, **LeadStatus**, **Title**, **MobilePhone** - Entity nodes for update details.

   * **updateLeadScript** - Bot action script to update a lead.

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img13.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=7b6001c1acb539ab65d95d2c9e2db64f" alt="updateLeadScript bot action component properties" width="1033" height="481" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img13.png" />

   * **updateLeadService** - Bot action service to update a lead.

   * **subDomainService** - Bot action service to fetch subdomain.

   * **updateLeadMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test. After entering lead details, the lead is updated in Salesforce CRM. Click **View Lead** to see updated details:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img14.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=0f949cbe3c8d1958f6cebca99dc5a502" alt="View lead details" width="1038" height="547" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img14.png" />

***

### Delete a Lead

1. Install the template from [Salesforce Action Templates](/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Delete Lead** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img15.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=e5cccc53ed0204044a23189c52528ffb" alt="Delete Lead dialog task is added" width="1515" height="916" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img15.png" />

   * **Delete Lead** - User intent to delete a lead.

   * **ID** - Entity node for the lead ID.

   * **deleteLeadService** - Bot action service to delete a lead.

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img16.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=a79e82c1bc4d13b2a64229b2472c05e0" alt="deleteLeadService bot action component properties" width="1901" height="907" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img16.png" />

   * **deleteLeadMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img17.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=929ce317f231434d308ae1e32dbbb99c" alt="VA prompt to delete a lead" width="549" height="737" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img17.png" />

***

### List All Leads

1. Install the template from [Salesforce Action Templates](/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **List All Leads** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img18.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=2e03d6242d397fcd64f8434000d5433f" alt="List All Leads dialog task is added" width="1514" height="901" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img18.png" />

   * **List All Lead** - User intent to list all leads.

   * **listAllLeadsService** - Bot action service to fetch all leads. Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img19.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=79ab8f3d68a7bee6152f0a0aecf5eef3" alt="listAllLeadsService bot action component properties" width="1913" height="835" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img19.png" />

   * **subDomainService** - Bot action service to fetch subdomain.

   * **listAllLeadsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img20.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=653b9c167967fa79186f63646fbd6a45" alt="VA prompts to view all leads" width="512" height="743" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img20.png" />

***

### View a Lead By ID

1. Install the template from [Salesforce Action Templates](/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **View Lead by Id** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img21.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=e954301d7a4f9985abdb7d4b94839363" alt="View Lead by Id dialog task is added" width="1470" height="910" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img21.png" />

   * **View Lead by Id** - User intent to view a lead by ID.

   * **ID** - Entity node for the lead ID.

   * **viewLeadbyIdService** - Bot action service to view a lead by ID. Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img22.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=dd5da8add18ef8a389368a41a558272f" alt="Add response" width="1914" height="901" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img22.png" />

   * **subDomainService** - Bot action service to fetch subdomain.

   * **viewLeadbyIdMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img23.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=3ee5cb6b142a261cbc9d97c8f8e9d0bd" alt="VA prompts to view lead by id" width="512" height="720" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img23.png" />

***

### Search Leads

1. Install the template from [Salesforce Action Templates](/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Search Leads** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img24.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=daa1a820f0d0aaba3298167f4fe9648b" alt="Search Leads dialog task is added" width="1703" height="877" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img24.png" />

   * **Search Leads** - User intent to search leads.

   * **Keyword** - Entity node for search keywords.

   * **searchLeadsService** - Bot action service to search leads. Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img25.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=9490c8d9e486186089be9f64d9a984f6" alt="Add response" width="1914" height="835" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img25.png" />

   * **subDomainService** - Bot action service to fetch subdomain.

   * **searchLeadsMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img26.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=269d9117c74950cd29b4384e1f6c25bc" alt="VA prompt to view all leads" width="550" height="838" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img26.png" />

***

### Create an Opportunity

1. Install the template from [Salesforce Action Templates](/ai-for-service/integrations/actions/configuring-the-salesforce-crm-action#step-2-install-the-salesforce-action-templates).

2. The **Create Opportunity** dialog task is added with the following components:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img27.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=1db6fdc705dca837e1da3450c58a250e" alt="Create Opportunity dialog task is added" width="1517" height="910" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img27.png" />

   * **Create Opportunity** - User intent to create an opportunity.

   * **Opportunity Name**, **Closed Date**, **Stage of Opportunity** - Entity nodes for opportunity details.

   * **CreateOpportunityService** - Bot action service to create an opportunity. Click **Edit Request**:

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img28.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=9b0d97d108ee71359b5eae11117737e2" alt="Edit request" width="1919" height="833" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img28.png" />

     **Sample Request:**

     ```json theme={null}
     {
       "attributes": {"type": "Opportunity"},
       "Name": "Project Charlie",
       "CloseDate": "2022-08-31",
       "StageName": "Prospecting"
     }
     ```

     Click **+Add Response**:

     <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img29.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=3606c84d3e66c28ba5ef439e4060235f" alt="Add response" width="1914" height="835" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img29.png" />

     **Sample Response:**

     ```json theme={null}
     {
       "id": "0065g00000O4bgDAAR",
       "success": true,
       "errors": []
     }
     ```

   * **subDomainService** - Bot action service to add subdomain.

   * **createOpportunityMessage** - Message node to display responses.

3. Click **Train**, then **Talk to Bot** to test:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img30.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=c5728fa4e66debd2a9633e6f21f3d591" alt="VA prompts to create opportunity" width="550" height="845" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img30.png" />

4. Click the **Chevron** icon to expand the new opportunity:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img31.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=dbadf43f6f9d47570a4fd023fcd6f87d" alt="Expand the new opportunity" width="552" height="781" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img31.png" />

5. Click **View Opportunity** to see opportunity details in Salesforce CRM:

   <img src="https://mintcdn.com/koreai-content-gov/TpmUI_SU3PXzVebD/ai-for-service/integrations/actions/images/salesforce-tem-img32.png?fit=max&auto=format&n=TpmUI_SU3PXzVebD&q=85&s=9b5ffe264675c39c77569b223b793ccf" alt="View opportunity details" width="548" height="852" data-path="ai-for-service/integrations/actions/images/salesforce-tem-img32.png" />
