How to integrate and query a database with the 'DB' component in wolkvox Studio (MySQL)
Table of Contents
Introduction
The “DB” component of wolkvox Studio allows you to connect a MySQL database to create, read, update, and delete information from your flows. It is available in the Communications group and can be used in all routing types (Voice, Interaction, Chat, and CRM + Webhook), as well as Agent Scripting. Its purpose is to enable the flow to query or register data in real time (for example: order status, quotas, customer data, validations, etc.) without leaving the routing logic.
Configuration
- Open the component's configuration panel by double-left-clicking on it.
- In the DB component panel, you will see these fields:
- Database Engine: Select the DB engine. Although it is a dropdown, for now, the only compatible option is mysql.
- Server IP: Enter the IP address of the server where the MySQL database you are connecting to is hosted.
- DB User: This is the database user with which the connection and query execution will be performed.
- DB Password: The password associated with the database user entered in “DB User”.
- Database Name: The exact name of the database (schema) within the MySQL server.
-
Query: Here you write the query or action you are going to execute in the database. It can be an operation for:
- Reading (SELECT)
- Creation (INSERT)
- Update (UPDATE)
- Deletion (DELETE)
- Variable $bd_row: This is the name of the variable where wolkvox will store the result of the query execution. This variable is used later in other components of the flow to make decisions, build responses, validate data, etc.
- Click on “Save DB info” to apply the configuration.
