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