---
schema_version: "1"
id: 0a37862b920c864070db4d6fa00af9ed7f6c666c8c3e22e014d4558a8acfbd96
title: Create Custom Context Variables
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/bots_service_custom_context_variables.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.bots_service_custom_context_variables.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: bf9bfa1c2640cb57b407f09d266440458eece7f23469e4ac2c162715c2853875
description: Context variables for the contact are included, but you can create any type of context variable to use in your bot implementation. Use context variables for product names, store locations, referral URLs, or items in a customer’s shopping cart.
products:
  - Service Cloud
  - Service Intelligence
release: "264"
---
# Create Custom Context Variables

Context variables for the contact are included, but you can create any type of context variable to use in your bot implementation. Use context variables for product names, store locations, referral URLs, or items in a customer’s shopping cart.

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

<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="d60760e57">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d60760e57 ">To build and manage Einstein Bots:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d60760e57 ">
              <p>Customize Application</p>
              <p>OR</p>
              <p>Modify Metadata</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Manage Bots</p>
            </td>

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

Custom context variables can be linked to multiple channels and objects. The Chat channel can map to the LiveChatTranscript object and the Messaging Channels can map from either the MessagingSession or MessagingUser objects.

Deleting mappings on custom context variables affect functionality. We recommend that you note where custom context variables are used to prevent data loss or showing merged fields inside a conversation.

1. Start with a deactivated bot. If your bot is active, click **Deactivate**.
2. In the Bot Builder menu, select Variables.
3. To create a variable, click **New**. Set the type to Context and give it a name and Data Type. Save your changes.
    
    ![Create a custom context variable.](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_custom_context_variable_create.png)
    
    ![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 Custom context variables must have a Data Type of Text, Number, or ID.
4. To open the variable detail page, click the variable name. To create a variable mapping, click **New**.
5. To map to the variable, select the Channel and the Field. Save your changes. The mapping shows with the channel and the API name of the mapped field.
    
    ![Create mappings to your custom context variable.](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_custom_context_variable_mapping.png)