---
schema_version: "1"
id: 1b691cea8205e38daa800c8f39c622dcf6ba9660146d10eb108f331e0b7b757d
title: Configure Agentforce Context Variables
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/configure_agentforce_context_variables.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.configure_agentforce_context_variables.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: e6d9ecae06019f3c08320d2ffbd5706e08012eaa5e31799829c6a209206ecd21
description: Map your custom fields as parameters in the Embedded Service Deployment to pass campaign data to the agent.
products:
  - Service Cloud
  - Service Intelligence
release: "264"
---
# Configure Agentforce Context Variables

Map your custom fields as parameters in the Embedded Service Deployment to pass campaign data to the agent.

### 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: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Available in Enterprise, Performance, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions. Access to some standard agent actions requires <a href="https://www.salesforce.com/agentforce/pricing/" target="_blank">additional add-on licenses</a>.</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <a href="https://www.salesforce.com/agentforce/pricing/" target="_blank">LWR</a> and <a href="https://help.salesforce.com/s/articleView?id=experience.exp_cloud_basics_glossary.htm&amp;language=en_US&amp;type=5" target="_blank">Aura</a></td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Enhanced Chat with the Einstein for Service, Einstein Platform, Community, Community Plus, or Agentforce for Service add-on</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Available in Enterprise, Performance, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions. Access to some standard agent actions requires <a href="https://www.salesforce.com/agentforce/pricing/" target="_blank">additional add-on licenses</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="d86636e95">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d86636e95 ">To build and manage Service agents:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d86636e95 ">Manage Agentforce Service Agents AND Manage AI Agents OR Customize Application </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d86636e95 ">To set up this feature:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d86636e95 "> set up this feature: Customize Application AND Modify Metadata Through Metadata API
              Functions </td>

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

Context variables act as a bridge between your CRM (Customer Relationship Management) data and the chat interface. Mapping these variables makes sure that when a proactive chat starts, the system automatically populates the session data required for the agent to function correctly.

1. From Setup, in the Quick Find box, enter Messaging Settings, and select **Messaging Settings**.
2. Click the name of the messaging channel you created for proactive service.
3. Under Custom Parameters, click **New**.
4. Create parameters for the Service Campaign ID, Service Campaign Member ID, and Service Agent prompt.
    
    For the best results, match the parameter name to the channel variable name.
5. From Setup, in the Quick Find box, enter Embedded Service and select **Embedded Service Deployments**.
6. Find your deployment and select **View** from the dropdown menu.
7. Select **Edit Pre-Chat** and make sure that you activate the pre-chat feature.
8. Under Hidden Pre-Chat Fields, select your custom parameters from the Available list and move them to the Selected list.
9. Save your changes and click **Publish** on the deployment settings page.

#### See Also

- [Customize Pre-Chat for Enhanced Chat](https://help.salesforce.com/s/articleView?id=service.miaw_custom_prechat_3.htm&language=en_US)