What are Bot Variables? How to Use Bot Variables
- Getting Started
- Bot Building
- Smart Agent Chat
- Conversation Design
-
Developer Guides
Code Step Integration Static Step Integration Shopify Integration SETU Integration Exotel Integration CIBIL integration Freshdesk KMS Integration PayU Integration Zendesk Guide Integration Twilio Integration Razorpay Integration LeadSquared Integration USU(Unymira) Integration Helo(VivaConnect) Integration Salesforce KMS Integration Stripe Integration PayPal Integration CleverTap Integration Fynd Integration HubSpot Integration Magento Integration WooCommerce Integration Microsoft Dynamics 365 Integration
- Deployment
- External Agent Tool Setup
- Analytics & Reporting
- Notifications
- Commerce Plus
- Troubleshooting Guides
- Release Notes
Table of Contents
What are Bot Variables?
Bot Variables are Key-Value pairs used for making configurable Bot Responses in the bot.
Assume, that you have a bot and your users have used it for a good period of time. Now, there is some change that has taken place in your business, say for example, the business name, and you want to update this on all the Bot Responses in your bot. To update all Bot Responses, you need to go to each and every Step of your bot and update the Bot Responses one by one. This is a very tedious and time-consuming task. This is where Bot Variables come handy.
With Bot Variables, you will be able to make a bot-wide change at once, as opposed to visiting each and every Step and making a change one by one. This will reduce your overall time of bot-building, making it one of the most time-saving and efficient features on the Haptik platform.
You can simply create a list of Bot Variables before building the bot by defining key-value pairs of texts which you want to make configurable in your bot, and then proceed with the regular bot-building activity. Now, you just need to add the Bot Variables KEYS in the Bot Responses to make it configurable.
Creating Bot Variables
In order to create Bot Variables, open your bot and navigate to the vertical ellipsis, as shown.
To create a new or edit an existing Bot Variable, click on Edit Bot Variables, and select Add a Bot Variable as shown.
Next, you will see this pop-up, where you need to add the Key and Value pair, as shown. The Key is the unique name and cannot be changed after creation, and the Value can be changed as and when required.
Make sure that every Key has one Value per language if you are using this feature on a Multi-lingual bot. Also, while adding a new Variable, you can add at the most 50 Keys, where the maximum length of each Key is at the most 50 characters and that of each Value is 256 characters. All Value characters are allowed to include spaces, numbers, and special characters, whereas for a Key, you can only use lowercase alphabets, underscore, and numbers. The Value cannot be empty across any language. The Key names should be unique at a bot level and are not editable across any language.
Once you are done adding a Bot Variable, click on the Save button to save it.
Using Bot Variables
Once you have created Bot Variables, you can use them across all Static Steps in your bot. You can simply add or edit a Bot Response and you will see an Add Variable button, as shown.
After clicking on the Add Bot Variable, you will see a list of your added variables. Simply, select the Bot Variable that you want to add or search it by entering its name.
When you click on the Bot Variable, it will be added to the Bot Responses, as shown.
Apart from this, you can add a Bot Variable in a Static, Output, and FAQ Step, in the following places:
- Bot Responses
- Follow-up Messages
- Entity Bot Responses
- Final Responses
What's more, you can add a Bot Variable in the following types of Bot Responses:
- Text & Quick Replies
- Buttons
- Carousel
- Image
- Raw Text/JSON
Still need help? Reach out to your Haptik SPOC right away :)