Loading
Salesforce now sends email only from verified domains. Read More
Build AI Solutions for Service
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Use Pre-Chat with an Enhanced Bot

          Use Pre-Chat with an Enhanced Bot

          Use an enhanced bot to gather important customer information and customize a conversation with a bot or service rep on Enhanced In-App Chat or Enhanced Web Chat channels. After you set up pre-chat for Enhanced Chat, create and map custom bot context variables to the Messaging Session object.

          Required Editions

          View supported editions for Einstein Bots.
          View supported editions for Messaging.
          User Permissions Needed
          To build and manage Einstein Bots:

          Customize Application

          OR

          Modify Metadata

          OR

          Manage Bots

          Before you begin, set up pre-chat for Enhanced Chat.

          1. Create and customize your Enhanced Chat pre-chat form. You can add standard and custom fields.
          2. Map your pre-chat values to your Messaging Channel, then update your Omni-Channel flow. Create an Update Records element before the Route Work element in the flow that you use to route to your enhanced bot.

          Create Custom Context Variables

          When you set up pre-chat for Enhanced Chat channels, you created a custom field on the Messaging Session object for each of your pre-chat fields. Now to use pre-chat with your bot, for each custom field that you created on the Messaging Session object, create a custom bot context variable.

          1. Navigate to the enhanced bot that you want to use to collect pre-chat data. From Setup, in the Quick Find box, enter Einstein Bots, and then select Einstein Bots. From the Einstein Bots Setup page, click the name of your bot to launch the Bot Builder.
          2. From the Bot Builder menu, select Variables.
          3. In the Variables list view, click New.
          4. In the Type field, select Context.
          5. Enter a variable label and API name. Choose a name that makes it easy to remember the corresponding Messaging Session field but isn’t identical.
          6. Select a data type. The data type of your context variable must match the data type of the corresponding Messaging Session field.
          7. Save your changes.

          Map Your Context Variables

          Map your new custom context bot variables to the corresponding fields on the Messaging Session object. Mapping lets your bot use an Omni-Channel flow to load pre-chat data from the context variables into the fields on the Messaging Session object. Then the bot or service rep has access to the information within the Messaging Session record during a conversation.

          1. To open the variable detail page, in the Variables list view, click the name of your new variable.
          2. To create a variable mapping, from Context Variable Mappings, click New.
          3. In the Connection Type field, select Embedded Messaging.
          4. In the Field Name field, select the corresponding Messaging Session field.
          5. Save your changes.

          Add Context Variables to Your Bot

          To collect customer responses with your bot, add each custom context variable to a dialog Question step.

          For more information, see Using a Dialog Question Step.

           
          Loading
          Salesforce Help | Article