Variables are placeholders that store and re-use information from the user during a conversation flow. Variable values are saved by actions during the conversation flow. You can configure a default value for a variable that is used by the chatbot until a value for this user is saved. This default value is the same for all users in your chatbot.
If your variable does not have a default value and your chatbot tries to use it before a value for the user has been saved, the chatbot displays:
- A blank value, if the variable is used with other text or emojis in the message bubble or button.
- An error, if there is no other content in the message bubble or button.
For example, you have variable that stores the user's name, and the variable is used later in the conversation to address the user by name when confirming an appointment: "Is this appointment for <name> or somebody else?"
If the user declines to give their name, the variable would be blank: "Is this appointment for or somebody else?". But if the variable has a default value of "you", it will use that value instead if the user hasn't given their name: "Is this appointment for you or somebody else?"
If an action in your conversation flow resets the variable value, it returns to the default value.
Add a default value
- Open the team and chatbot you want to work with.
- Click Variables in the left navigation.
- Click the name of the variable you want to add a default value to.
- Select This variable requires a default value.
- In the Value field, type the default value to use.
- Click Save.
Comments
Article is closed for comments.