Use variables to create placeholders that will store and re-use information from the user during a conversation flow. Variables are great for making your chatbot conversation more specific and personal to the user, and for reducing duplication in your content flow.
The value in a variable will be set individually for each user based on their interaction with your chatbot. If you want to create a placeholder for a value that will be the same for every user every time, such as a business name, use a constant.
Use variables to:
- Personalise your chatbot flow by addressing the user by their name.
- Make your conversation feel more specific by using information from your user in your messages and button text.
- Reduce duplicate passages in your chatbot content by swapping in key information such as product or model names.
- Direct the flow of a conversation based on a variable's value.
Variables can be used in messages your chatbot sends, including text, buttons, Quick Replies, and script parameters, and can be also set as the value of other variables using actions.
Plan your flow!
Variable values must be saved using actions in the conversation flow before they're used. If your chatbot tries to use a value before it has been set and the variable does not have a default value, it will display an empty value. Make sure you test your variables before you publish.