Loading
Prepare for Email to Become the Default Login ExperienceRead More
Build AI Solutions for Service
What’s a Variable?

What’s a Variable?

A variable is a container that stores a specific piece of data collected from the customer or output from Salesforce. Since variables are containers of information, they can be used within dialog actions as both inputs and outputs and can be inserted as part of the text in messages.

Required Editions

View supported editions.
Note
Note Starting August 17, 2026, Einstein Bots is in Maintenance Mode. Existing Einstein Bots continue to be supported and can be used after August 17, 2026. However, no new features or enhancements will be added, and we recommend using Agentforce for new AI agent implementations. See Upgrade Bots to Service Agent and Learn about Agentforce.

There are three types of variables in the Bot Builder: Custom, Context, and System.

Create custom variables to store information gathered from your customers. Use context variables to create channel-independent bots. Use the system variable to capture the last customer input with the bot. Variables are specific to the version of the bot in which they’re created. Variables can be inserted in bot messages and questions using standard merge syntax.

The following types are available for custom variables.

  • Text
  • Number
  • Boolean
  • Object
  • Date
  • DateTime
  • Currency
  • Id

Object type variables store full records with fields. For example, you can use a flow to retrieve a contact record, store the record in an object type variable, and then access one of the record fields, such as “Name”.

Id is a text type variable with a restricted character count.

  • Add a Custom Variable
    Create custom variables to store information gathered from your customers.
  • Understand Context and System Variables
    Access important information during bot conversations with context and system variables. Context variables let your bot gather customer information regardless of channel. System variables store back-end information about conversations.
 
Loading
Salesforce Help | Article