---
schema_version: "1"
id: b56725aefd12c20e8c81f5908d75ba1ea20da141984555677186cd9c3321001c
title: "Learn About the Template Bot: Connect with Sales"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/bots_service_template_sales.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.bots_service_template_sales.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 15b9b36a44d81bcb2e3d566ae68f223c1645550c6bc9f198280a0c25171ec05d
description: Build a bot to capture end user information and create a lead record.
products:
  - Service Cloud
  - Service Intelligence
release: "264"
---
# Learn About the Template Bot: Connect with Sales

Build a bot to capture end user information and create a lead record.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.einstein_service_intro.htm&amp;language=en_US" target="_blank">View supported editions</a>.</td></tr></tbody></table>

The Connect with Sales dialog skill, the group of dialogs used to complete a task, helps your prospects and existing customers contact your sales representatives. Using the bot, customers can learn more about your products and services, schedule a demo, ask for a quote, and more. The first thing you notice in the Connect with Sales dialog is that there are two rules up front. These rules are designed to handle scenarios where the user created a lead already. The bot avoids creating a duplicate lead and instead informs the user that a Lead was created already.

The first rule covers the scenario where a Lead was created by a pre-chat form. In this scenario, the bot displays a message indicating that it already has lead information, and it routes the user to the Anything else? dialog so they go back to the Main Menu.

![A rule diaog step with lead information.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_template_sales_lead_2.png)

The second rule covers the scenario where the user has been through the Connect with Sales dialog skill one time and created a lead. The bot follows the same behavior as the previous scenario, displaying a message and routing to the Anything else? dialog.

![A rule dialog step shown if the customer already created a lead in this session.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_template_sales_lead_id_2.png)

Next, the bot handles the scenario where the information necessary to create a lead has been entered, but a lead hasn’t yet been created. In this case, the bot still creates a lead, but it skips the step where it asks the user questions to gather information.

![A rule dialog step to create a lead.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_template_sales_rule_2.png)

The next rule follows a common pattern across dialogs. The bot first calls the Get user info dialog to gather information, and then it calls the Create Lead dialog to create a lead record using that information.

![A rule dialog step to call the Create lead dialog.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_template_sales_call_2.png)

## Create Lead

Next, let’s look at the Create Lead dialog, where you see an action that invokes a flow to create a lead record:

![An action dialog step launching the Create Lead flow.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_template_create_lead_2.png)

The Routable Id is also included as an input so that the lead can be attached to the appropriate chat transcript.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/images/icon_note.png)

Note The Routable Id is a context variable that is equivalent to the Chat Transcript Id. To learn more about context variables, check out [Using Context and System Variables](https://help.salesforce.com/s/articleView?id=service.bots_service_context_system_variables.htm&release=264.0.0&type=5 "Access important information during bot conversations with context and system variables. Context variables let your bot gather customer information regardless of channel. System variables store back-end information about conversations.").

The flow also outputs the ID of the created lead record, which is mapped to a bot variable. This way, the bot knows that a lead has been created, so that it can avoid creating a lead again.