In this tutorial, we will set up a table and use the information in the table.
A table consists of a ‘term’ and informational fields about that ‘term’. Servisbot expects this to be represented in CSV format.
Example:
term, description, description2
virtual_assistant, A virtual assistant is a collection of bots working together, A virtual assistant does multi-bot orchestration
bot, A bot handles conversations for a particular topic, A bot takes messages from a person and infers a reply
To create the table use the cli command sb-cli table create servisbot_definitions ./PATH_TO_CSV
Create a bot from blueprint and select the ServisBOT Flow blueprint, name the bot ServisBOT Definitions
and add a welcome message of your choosing.
After the bot is created enter the flow designer and import the following Flow
The markup nodes in the flow use the following syntax:
<TimelineMessage>
<TextMsg> {CMS:servisbot_definitions:virtual_assistant}</TextMsg>
</TimelineMessage>
This will take the virtual_assistant term from the servisbot_definitions table and display the first non-term field. In this case description
Deploy the new flow and test the bot by interacting with the menu. It should look like this:
<TimelineMessage>
<TextMsg> {CMS:servisbot_definitions:virtual_assistant:description2}</TextMsg>
</TimelineMessage>
This will take the virtual_assistant term from the servisbot_definitions table and display the named field description2
<TimelineMessage>
<TextMsg> {CMS:servisbot_definitions:virtual_assistant:_random_}</TextMsg>
</TimelineMessage>
This will take the virtual_assistant term from the servisbot_definitions table and display a random non-term field
<TimelineMessage>
<TextMsg> {CMS:servisbot_definitions:${term}}</TextMsg>
</TimelineMessage>
This will take the term from context and lookup from the servisbot_definitions table and display and display the first non-term field. In this case description
<TimelineMessage>
<TextMsg> {CMS:servisbot_definitions:${term}}:description2</TextMsg>
</TimelineMessage>
This will take the term from context and lookup from the servisbot_definitions table and display the named field description2
<TimelineMessage>
<TextMsg> {CMS:servisbot_definitions:${term}}:_random_</TextMsg>
</TimelineMessage>
This will take the term from context and lookup from the servisbot_definitions table and display a random non-term field
<TimelineMessage>
<TextMsg> {CMS:${table}:${term}}:_random_</TextMsg>
</TimelineMessage>
This will take the term from context and lookup from the table in context and display a random non-term field
When filling in context in the flow designer it will show the preview resolving the item as shown: