Chatbot
...
Workflow
Database
9 min
overview the database is an integrated feature within the exo chatbot platform that allows you to create, manage, and utilize custom tables to store and retrieve persistent information it acts as the chatbot's memory, enabling you to save data collected from users during a conversation and use it in subsequent interactions or for offline analysis this feature is essential for building dynamic, data driven conversational flows instead of losing information once a conversation ends, you can store it in a structured way the database is directly accessible from the flow builder through the "database" action element, allowing you to perform common database operations like inserting, updating, searching for, and deleting records as part of a user journey key capabilities of the database module include custom table creation define your own tables with custom columns and data types (e g , string, integer, boolean) manual and bulk data entry add records one by one through the console or upload data in bulk using a csv file flow builder integration seamlessly connect your conversation flows to your tables to read and write data in real time data management search, edit, delete, and export table data directly from the user friendly console interface how to use database this guide details how to create and manage tables within the database module and how to connect them to your conversation flows 2 1 navigating to and creating a database table from the main console menu, navigate to workflow > database if no tables exist, click the + add table button this will open the "add table" configuration panel define the table structure table name enter a name for your table (e g , customer leads) note use lowercase letters and underscores instead of spaces field name enter the name for your first column (e g , user name) field type select the appropriate data type from the dropdown (e g , string, integer, date) searchable check this box if you want to be able to search the contents of this column from the database interface click add another field to add more columns as needed create the table once all columns are defined, click create table (alternative) import from csv you can also create a table by clicking import csv , which allows you to upload a csv file the system will create a table with columns matching the headers in your file 2 2 managing table data navigation workflow > database select the table you wish to view from the list on the left add a record click the + add new records button to manually add a new row to the table edit/delete a record in the table view, use the pencil (edit) or trashcan (delete) icons in the actions column for each row search use the search bar to find records this only works for columns that were marked as "searchable" during creation export click the export sheet icon to download the entire table's contents as a csv file 2 3 using the database in the flow builder in the flow builder, add a new step and select the actions category choose the database element select table from the dropdown, choose the table you want to interact with select action choose the operation you want to perform insert entry to add a new row map the table columns to the variables where you stored the user's input (e g , map the user name column to the {name variable}) update entry to modify an existing row (requires a search condition) search entry to look up a record delete entry to remove a row common examples and use cases lead generation a flow asks a user for their name, email, and phone number using prompts an insert entry action then saves this information into a leads table saving user preferences a user specifies their communication preference (e g , "email") this choice is saved to a user profiles table and can be retrieved in future conversations checking application status a flow asks a user for their application id a search entry action looks up that id in a pre populated applications table and returns the status to the user product information lookup create a table with product details (name, price, features) a bot can search this table to answer specific user questions about a product best practices plan your schema before creating a table, plan the columns and their data types mismatched data types (e g , trying to save text in an integer column) will cause errors use descriptive names use clear and logical names for your tables and columns (e g , user email instead of ue) this makes them easier to manage in the flow builder make necessary fields searchable only enable the "searchable" option for columns you will genuinely need to search frequently, like user id or email, to maintain good performance use variables always store user input in variables first, and then use those variables to perform database actions this keeps your logic clean and easy to debug common mistakes incorrect naming using a table or column name in the flow builder that doesn't exactly match the name in the database will result in an error names are case sensitive forgetting to create the table first trying to use the database action in a flow before the table has been created in the database module will fail data type mismatch attempting to insert a value of the wrong type into a column (e g , saving the text "five" into a column defined as an integer) assuming all columns are searchable trying to search a column that was not marked as "searchable" during creation will yield no results note this module is available on version 8 and onwards
🤔
Have a question?
Our knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.