Kore.ai bots platform provides a way to declare and use variables within the bot. These variables can be used to capture values that are commonly used by different tasks, nodes, and other bot elements
In this How-To, we will explore a scenario in a Banking Bot, where Bot Variables can be used. We will see how Content Variables can be used to pass language-specific messages.
In our Banking Bot, we welcome users when they connect to the Bot. The bot is multilingual and we want the messages to be in the appropriate user language.
In this document, we will see how Content Variable can be used to store the message in multiple languages.
- Bot building knowledge
- A Banking Bot with the on Connect event configured as below:
- From Natural Language -> Default Conversation select Event Handlers.
- Click on On Connect event and configure to Show Message
- Enable the Spanish language for the bot
- From Settings -> Config Settings, select Language Management and enable the Spanish language.
Declaring a Content Variable to hold the On Connect message will ensure it is not missed in the language translation.
- Open the Banking Bot.
- From Settings -> Config Settings select Content Variables section.
- Click Add Content Variable to open the corresponding window.
- Enter Variable Name and Variable Value. For this use case were are calling the Variable connectMessage, and for the value, we are entering the “Welcome to the Banking Portal – your one stop for all banking needs”.
- Now switch the language to Spanish and for the same connectMessage variable using the edit icon enter the text in Spanish – “Bienvenido al portal bancario: su única parada para todas las necesidades bancarias“.
- Return to the On Connect Event Handler and replace the text with reference to the content variable using the following code:
- Save the changes.