Expose Context Variables in Your Agentforce Service Agent

To make the custom fields created on the Messaging Session object available to your agent, expose them as context variables in Agentforce Builder. This action establishes the direct data link required for your Agentforce Service agent to reference and utilize user journey data when executing actions and guiding responses.

Required Editions

Available in: Salesforce Classic and Lightning Experience
Available in: Aura and LWR Experience Cloud Sites
Available in: Enhanced Chat with the Einstein for Service, Einstein Platform, Community, Community Plus, or Agentforce Service Agent add-on
Available in: Enterprise, Performance, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions. Access to some standard agent actions requires additional add-on licenses
  1. From Setup, in the Quick Find box, enter Agent, and then select Agentforce Agents.
  2. From the Agents Setup page, click the name of your agent Agentforce Service agent to open its details.
  3. Click Open in Builder, and then select the Context tab. If your agent is in read-only mode, deactivate it first.
  4. In the Messaging Session Variables section, click Update Included Fields.
  5. Select the custom fields you created on the Messaging Session object, and then save your changes.

    The custom Messaging Session fields you select are exposed in Agentforce Builder as context variables and become available to map to action inputs and to reference in topic instructions.