Health bot instance variables
During the scenario execution, the scenario author can store and retrieve variable values. There are also variables that are pre-populated by the framework. All variables are contained in our secure storage during the session of the conversation. This means that even if the connection is lost during the conversation or something happens to our servers, all the variables are restored when the conversation is resumed. User data is maintained between conversations.
There are three types of variables you can use inside the action and other expression fields:
Scenario variables are prefixed with a
scenario. For example
myVarwould be accessed using the syntax
scenario.myVar. Scenario variables live throughout the lifespan of a scenario. When a scenario ends and returns to the calling scenario, the variables are removed. This means you can write reusable scenarios.
Conversation variables are prefixed with a
converstionsign. For example
myVarwould be accessed using the syntax denoted by
conversation.myVar. Conversation variables can persist accross several scenarios throughout the lifespan of the conversation session.
User variables are prefixd with an
user. For example,
myVarwould be acccessed using syntax denoted by
user.myVar. They persist indefinetly accross conversations with the same user. User variables are deleted when the user makes an explicit request to be forgotten.
All notations (
user) are just abbreviation of the actual
place this data is stored. They are expanded during runtime to the
|Variable||Real data location|
Examples are visible in the Debug Context. In
theory, you can write the long form of the variables (e.g.,
session.privateConversationData.myvar) but this is not recommended,
especially for scenario variables.
The old variable notations ($, @, &) are still supported along side the new notations, but will be deprecated in the future. It's highly recommended using the new notations.
Instance variables are scoped to a specific user or conversation. Global variables are available to all users and can be accessed from any scenario.
Global variables are managed via the special step in the visual editor or programatically using a special syntax. Learn more about global variables.