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 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:
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.
By default, the following variables are added to your chatbot runtime by Xenioo:
The username (or nickname) of the user, if available.
The first name of the user
The last name of the user
The locale of the user in 4 letters iso format (e.g. en-US)
The channel based user id. This value is unique to the channel
Single use throw away token. The value changes every time it is used
The name of the current conversation channel (e.g. "WhatsApp" )
The last message the user has sent
The last command that was triggered by the user
The locale that Xenioo has detected by NLP or scripting in 4 letters iso format (e.g. en-US)
The last number of failed inputs
Contains true if the last input has triggered a failure. Otherwise false
Contains the current chat state according to the table below
The full date and time of the very first contact your chatbot had with the current user.
The day of the month of the very first contact your chatbot had with the current user.
The full name of the day of the week (e.g. Saturday) of the very first contact your chatbot had with the current user.
The month of the very first contact your chatbot had with the current user.
The year of the very first contact your chatbot had with the current user.
Contains a fixed value representing the last platform actor to interact in the current flow. It may contain "user" if the last interaction was from the user or "xenioo" if the chatbot was the originator of the last message or the operator email, if the last message was from an operator.
The full date and time of the last contact that your chatbot had with the current user. If the conversation is alive, this value is constantly updated after each interaction.
The day of the month of the last contact your chatbot had with the current user.
The full name of the day of the week (e.g. Saturday) of the last contact your chatbot had with the current user.
The month of the last contact your chatbot had with the current user.
The year of the last contact your chatbot had with the current user.
If the channel requires an optin message (e.g. WhatsApp) this variable will hold the value of the very first message sent by the current user to the channel.
The device state retrieved by Xenioo IoT actions. May vary depending on device.
The current conversation state in extended string format. Can be either Chatbot, OperatorRequested, OperatorTakenOver or UserBanned.
The number of operators online for the current chatbot. This value is updated on every user interaction. When not looking at a live conversation it may represent a stale value.
The full list of operators currently online separated by a semicolon. Like for the operators count, this value is updated on every user interaction. When not looking at a live conversation it may represent a stale value.
The full account name of the currently active operator. This variable is valued only if the current conversation is taken over.
The full group name of the currently active operator. This variable is valued only if the current conversation is taken over.
True if the operator talked at least once with the user since take over. Empty otherwise.
The current offset of an ongoing streaming action. It represent the position along the stream in milliseconds.
The current unique token associated with the streaming operation.
The unique token associated to the previous streaming operation.
The current audio action as requested by an incoming state change in any IoT device update.
This variable will hold the type of message sent by the user. This variable is empty if the message is of type text, otherwise will contain either "image", "audio", "voice" or "file".
The following tags are created automatically by Xenioo during your chatbot runtime:
This tag is automatically added to a user if a previous conversation is not found. This tag is automatically removed when the user comes back to the chatbot after at least 30 minutes.
Chat State Values
The chat_state variable may contain the following values, depending on the current state of the chat:
The chat is in its default state. Xenioo is controlling your chatbot replies.
An operation has set the request operator flag. The chat is waiting to be taken over by an operator
The chat has been taken over by an operator and its currently managed by a human.
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 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 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:
Automatically added to the conversation on the very first contact. Subsequent conversations with the same user will no longer have this tag.
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.