Create variables to use across all your chatbot intents in Variables in Chatbot Studio. To use them in an intent, simply input the variable name surrounded by double curly brackets {} where you want it in the reply section of an intent.
Variables let you keep information centralised and change it globally across all your intents without needing changes in each individual intent.
Example
If you use your opening hours in many chatbot answers, you don't want to change each one by hand.
Using variables, you can change your opening hours in one place and they'll change automatically wherever your chatbot mentions your opening hours in a reply.
Create variables in Chatbot Studio
- Go to Chatbot Studio and select Bot and then the Variables tab.
- Click the Add variable button.
- Give the variable a short name and a description. The description tells your team members what the variable is for so keep it descriptive!
- Select a Type for the variable.
- Complete the Value for the variable, then click the Add variable button.
See it in action
Creating a variable in Chatbot Studio.
Using variables in your chatbot
- Go to your chatbot intents and create a new intent. You can also edit an existing intent and use variables there too.
- In the reply section of your intent configuration, a small tooltip will show you what variables are available for you to use.
- Write the intent name into the place where you want it to appear in your chatbot reply. Make sure the variable name is surrounded by double curly brackets. This tells your chatbot to check this variable.
- Click save, and publish your chatbot when you're ready.
See it in action
Using a variable in a chatbot reply in Chatbot Studio.
If you change the value for the variable in the "Variables" tab, the answer will change across all the intent replies where you have used that variable.
So if you change opening hours, you can reflect this in all your opening hours related intents with one action.