Variables and Tags

One of the pillars of your chatbot flow with Xenioo are Variables and Tags: while building your chatbot you will use both extensively to identify your users, store and display relevant runtime data.

Variables

Variables are entities defined through a name and value pair. Each variable has a name and an assigned value. While variables are defined globally during chatbot design, they all become bound to each conversation. For example if you define the variable favorite_color in your chabot design, all conversation will have it and each conversation may have a different value assigned.

Xenioo manages both basic, direct valued variables and complex object variables. Direct valued variables are the most common as they just old simple values like favorite_color="red". Complex object variables hold an object instance and can be accessed in both raw JSON value or by property name notation. A variable defined as follows:

favorite_color = {
    "name":"Red",
    "value":"ff0000"
}

Can be accessed and automatically parsed both by referring to favorite_color, which will return the full JSON or by favorite_color.name, which will just return Red.

There are no limits to the number of variables your chatbot conversation can have.

Regardless of initial choice, variable names are forced by Xenioo into snake_case convention.

Default Variables

By default, the following variables are added to your chatbot runtime by Xenioo:

Default Tags

The following tags are created automatically by Xenioo during your chatbot runtime:

Chat State Values

The chat_state variable may contain the following values, depending on the current state of the chat:

Please note that, depending on the channel and depending on specific user related privacy settings, some of the above variables may not be available. Additional, specific variables, may be added automatically to your chatbot runtime depending on the channel used by the user. Refer to each channel specific information for a complete list.

Privacy Variables

Privacy variables are a special type of variables that cannot be altered in any way from outside or inside the chatbot runtime.

These variables hold the selected privacy preferences of your user and only a Privacy Opt-in Action can alter these variables.

Tags

Tags are single named entities that can be attached to the conversation to later filter or switch the flow based on their presence (or the absence). If you do not need to store a value but you need to represent a simple flag, Tags are generally better.

By default, your chatbot will have the following tags:

Data Persistence

Both variables and tags are uniquely stored for each of you chatbot conversation. Every change you make to a variable or tag during your chatbot runtime is scoped to only the current conversation.

Every variable and tag is persisted in the conversation and kept available for any future contact or broadcast until you, or the user, choose to forget it.

Last updated