Variables can be used to store certain information in the bot and utilize it for a variety of purposes. 

Variables can thus be created to store information from the user such as “name”, “email”, “complaint-description” and later send it in e.g. an email or to a secondary software through an integration.

Variables come in 2 different forms in the chatbot:

  1. Normal variable: ${variablename}
  2. Entity variable: ${@variablename}

Normal variables can be saved and stored through the “save last user input” action or custom YAML and utilized e.g. by calling the variable name in the flow builder, using the above syntax. You can also send it between software with integrations or actions such as the email action.

The picture below shows an input (i.e. name) being stored as a normal variable called “Name”, and then being called/utilized right after in the flow.

Variable space

There are two spaces in which the variable can exist, these spaces depend on how the variable was referenced at the time of storing a value.

  1. User space variables: to use this variable simple add “user.” before the variable name when storing data or using the data in the variable e.g. ${user.variable}. These variables will be permanent for the user that interacts with the bot and can be utilized in any flow. 

  2. Local flow variables: these variables must be declared on Settings>Manage custom components>Set custom variables following YAML code structure, before being used. To use them just write the variable name e.g. ${variable}These are for temporary session-based purposes only as they reset on every session, and their value is reset when a flow ends.