---
schema_version: "1"
id: 43a2af21d12e6ca825e0aa618b2d8cfc5c9b9b32fb5b36bb7f555564e51d91b9
title: Gather Customer Information Using Pre-Chat
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/sales_einstein_bots_use_prechat.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.sales_einstein_bots_use_prechat.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: f7746aea2984676de9043f3d823af7141af2febeeb7fc5502be180612ee172ae
description: Add custom fields to your pre-chat form to store your chatting customer’s local and time zone information. Then you can auto-fill these hidden pre-chat fields when the conversation begins.
products:
  - Sales Cloud
  - Cross Cloud
  - Service Cloud Voice
release: "264"
---
# Gather Customer Information Using Pre-Chat

Add custom fields to your pre-chat form to store your chatting customer’s local and time zone information. Then you can auto-fill these hidden pre-chat fields when the conversation begins.

### 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;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with Sales in <strong>Performance</strong> and <strong>Unlimited</strong> Editions</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with Sales Engagement, which is available in <strong>Performance</strong> and <strong>Unlimited</strong> Editions, and for an extra cost in <strong>Professional</strong> and <strong>Enterprise</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d100926e84">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d100926e84 ">To customize pre-chat:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d100926e84 ">
              <p>Customize Application</p>
              <p>AND</p>
              <p style="margin-bottom:0;">Modify Metadata Through Metadata API
                Functions</p>
            </td>

          </tr>
        </tbody>
      </table>

1. Create custom parameters for your pre-chat form.
    1. From Setup, in the Quick Find box, enter Messaging Settings, and then select **Messaging Settings**. Then click **Buyer Assistant Messaging Channel**.
    2. Create a custom parameter that stores your customer’s locale. Save your changes and then create another custom parameter that stores your customer’s time zone. Save your changes. For both parameters, be sure to match the parameter name and channel variable name.
2. Add hidden fields to your pre-chat form.
    1. From Setup, in the Quick Find box, enter Embedded Service Deployments, and then select **Embedded Service Deployments**.
    2. Open the Buyer Assistant embedded service deployment, and then click **Edit Pre-Chat**.
    3. Under Hidden Pre-Chat Fields, select the custom parameters you created. Then save and publish your changes.
3. Add custom fields to your messaging session object.
    1. From Setup, in Object Manager, select the Messaging Session object.
    2. From the Fields & Relationships tab, create a custom field for your customer’s locale. Then create another custom field for your customer’s time zone.
4. Map the hidden pre-chat fields to flow variables in the Buyer Assistant - Route to Bot flow.
    1. From the Buyer Assistant Messaging Channel settings, create a parameter-mapping variable for your customer’s locale. Save your changes, and then create another variable for your customer’s time zone. For both variables, add a flow variable name that describes the action. Save your changes.
    2. From Setup, in the Quick Find box, enter Flows, and then select **Flows**. Find and select **Buyer Assistant - Route to Bot** from the list.
    3. Add an input variable for each pre-chat field. The API Name must be identical to the Flow Variable Name from Parameter Mappings. The Data Type must be set to Text. And the variable must be available for input.
    4. Create an Update Records element in the flow after the Route Work element. Name the element Update Messaging Session. Make sure that the element identifies records based on conditions and set fields individually. For the object type, select **Messaging Session**, filter based on the recordId value, and enter each pre-chat field and its corresponding flow variable name. Then click **Done**.
    5. Save your changes and activate the flow.
5. Create and map bot context variables to the custom object fields.
    1. Navigate to your Buyer Assistant bot. From the Bot Builder menu, select **Variables**.
    2. Create context variables that match the custom Messaging Session fields you created. For the data type, select **Text**. Save your changes.
    3. To map your custom context bot variables to the custom fields on the Messaging Session object, in the Variables list view, click your customer locale context variable.
    4. Create a context variable mapping. For the connection type, select **Embedded Messaging**. And for the field name, select **Messaging Session**.
    5. Save your changes and repeat the mapping steps for the time zone context variable. Then activate your bot.

Next, create a messaging channel and connect it to your website. Then embed your bot on your website and add code that collects data for your pre-chat fields.

#### See Also

- [Customize Pre-Chat for Enhanced Chat](https://help.salesforce.com/s/articleView?id=service.miaw_custom_prechat_3.htm&type=5&language=en_US)
- [Map Pre-Chat Values in Omni-Channel Flow](https://help.salesforce.com/s/articleView?id=service.miaw_map_messaging_2.htm&type=5&language=en_US)
- [Use Pre-Chat with an Enhanced Bot](https://help.salesforce.com/s/articleView?id=service.bots_service_enhanced_prechat.htm&type=5&language=en_US)