Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Get Started with B2C Commerce
Create Context Variables for Messaging Sessions

Create Context Variables for Messaging Sessions

Before you create your agent, personalize agent conversations with context variables. Context variables enable your agent to use messaging session record fields as inputs to send B2C Commerce site context to the agent.

  1. In your Salesforce org, at the top of the page, click Setup and select Setup.
  2. Select the Object Manager tab.
  3. In the Quick Find box, find and select Messaging Session
  4. Click Fields & Relationships | New.
  5. Add these new fields.
    Assign all the fields except for QueryFacets the Text data type. For QueryFacets, assign the Long Text Area data type, which has a maximum character limit of 131,072.
    • Currency
    • DomainURL
    • IsCartMgmtSupported
    • Organization ID
    • QueryFacets - Use Long Text Area
    • RefreshToken
    • SiteID
    • UsId
    • UserLocale
  6. For Salesforce Reference Architecture (SFRA) stores, add these new fields.
    Assign all the fields to the Text data type.
    • BooleanTrue
    • BooleanFalse
    • SfraNamedCredential
    • SfraAuthToken
    • CsrfToken
  7. Accept the default values for field-level security and click Next.
  8. Save the new field.
 
Loading
Salesforce Help | Article