Working with Mavibot tables

The "Tables" section in MaviBot is a tool for convenient data storage and management within the platform. You no longer need to switch between different services—all your tables are now available in a single project.

Features:

  • Create tables with any number of rows and columns.

  • Store and edit data without third-party tools or services.

  • Enter values, edit rows and columns, or delete them directly through the chatbot using functions.

Advantages:

  • Simplifies data management: you can enter information into a table directly from the bot.

  • Flexible and easy to use: create as many tables as you need and customize them for your business tasks.

Manage your tables without leaving Mavibot

How to create a table

To get started, go to the "Tables" section in the required project:

Next, you will see the "Create a table" button. Click it to open a modal window where you need to enter the table name:

Enter a name for the table and click "Done". The new table will then be created in the project and appear in the "Tables" section:

Table settings

After creating the table, you need to add rows and columns. To do this, find the "Go to" button on the desired table and click it:

You'll see the following settings:

  1. Function for adding columns:

а) to add lettered columns

The button adds columns labeled A to Z to the table.

b) to add columns with custom names

Clicking the button opens a modal where you can name the new column.

Enter a name and click "Done" to add the column to the table.

  1. Button for adding strokes:

  1. Table export

Allows you to export the table in CSV format with all data and values, for example, to move the table to another Mavibot project or to another spreadsheet service.

  1. The Import CSV feature enables you to upload data from an external service.

Other features

There is a dropdown menu that allows you to quickly browse tables without leaving the main section.

You can also create new tables directly from the side menu.

To delete a table, go to the main section:

Then, find the Delete button on the card of the table you want to remove.

How to enter values into the table

You can enter values into the table manually:

Or by using functions in the chatbot.

How to find a table ID

You will need a Table ID to use chatbot functions related to this table.

  1. Navigate to your table. Find the desired table in the list and click on its name to open it.

  2. Locate the Table ID in the address bar. Click on the address bar of your browser — the Table ID is the unique string of characters at the end of the URL.

  1. Example: In a URL like https://mavibot.ai/projects/11111/table/2 the Table ID is 2.

  2. Copy the ID Select and copy this number from the address bar to use in your chatbot configuration.

How to create a new record in the table

new_record(table_id, data) – create a new entry in the table with the specified values.

table_id – the ID of the table

data – a dictionary containing the data to be entered. Example: {"column_name1": "value1", "column_name2": "value2"}. If a column does not exist, it will be created. Response: the ID of the new entry

Example

How to edit an existing record in the table

edit_record(table_id, record_id, data)

table_id – the ID of the table

record_id – the ID of the entry to be edited

data – a dictionary containing the data to be updated. Example: {"column_name1": "value3", "column_name2": "value4"}. If a column does not exist, it will NOT be created.

Response: Returns the full data of the edited entry in the format {"column_name1": "value3", "column_name2": "value4"}

Example

How to delete a table record by its ID

delete_record(table_id, record_id)

table_id – the ID of the table

record_id – the ID of the entry to delete

Response:

{'message': 'Deleted entries: 1'}

How to find the first record with the specified value in a table

find_record(table_id, value, find_in, return_from)

table_id – the ID of the table

value – the value to search for

find_in – optional. The name of the column to search in. If not specified, the search will be performed across all columns

return_from – optional. The name of the column from which to return the value

Response: If return_from is specified, the value of the specified column will be returned (if it exists in the table). If return_from is not specified or the column does not exist, the full data of the found entry will be returned: {"column_name1": "value3", "column_name2": "value4"}

Example

How to get values from the specified record

get_record_data(table_id, record_id, return_column )

table_id – the ID of the table

record_id – the ID of the entry to retrieve values from

return_column – optional. The name of the column from which to return the value

Response: If the entry is found, returns a dictionary like {"column_name1": "value1", "column_name2": "value2"}. If return_column is provided and the column exists, only the value from that column will be returned.

How to retrieve all values when searching across multiple columns

find_records_multiple_cols_list(table_id, column_data, return_col, with_index, delimiter, algorithm) – Use this function when you need to search across multiple columns at once and retrieve a list of values from a column in rows where all values are found. (This is similar to the sheet_search_in_multiple_cols_return_list function for Google Sheets.)

table_id — the ID of the table

column_data — the search query, i.e., what you want to find

return_col — the column number from which to return values

with_index — index or numbering in the list of found values (0 – numbering (1, 2, 3,…); 1 – row index; "" – list of values on new lines without indexes or numbering)

delimiter — separator between the index and the value

algorithm — search algorithm (F – exact match, K – keyword match, R – regular expression, 1–100 – similarity percentage (see details above))

Example:

table_id = 7

data = {"age": "26", "city": "New York"}

return_col = "name"

with_index = 1

delimiter = " - "

algorithm = "F"

res = find_records_multiple_cols_list(table_id, data, return_col, with_index, delimiter, algorithm)

res_list = res["list"]

If the query executes successfully, the response is a dictionary containing the status and all cells with values:

{"status":true,"rows_index":[2,3],"quantity":2,"list":"2 - John\n3 - Anna"}

status — the search result

rows_index — an array with the numbers of the found rows

quantity — the number of rows found

list — a string with all values from the selected column

If an error occurs, the response will be status: false along with an error description: {"status": false, "error": "Error or description"}

How to retrieve the first value when searching across multiple columns

find_first_record_multiple_cols_row(table_id, column_data, algorithm) – use this function when you need to search across multiple columns at once and retrieve the first matching row. (This is similar to the sheet_search_in_multiple_cols_return_row function for Google Sheets.)

table_id — the ID of the table

columns — the search query, i.e., what you want to find

algorithm — the search algorithm (F – exact match, K – keyword match, R – regular expression, 1–100 – similarity percentage (see details above))

Example:

table_id = 7

data = {"age": "26", "city": "New York"}

algorithm = "F"

res = find_first_record_multiple_cols_row(table_id, data, algorithm)

row_data = res["row_data"]

row_id = row_data["ID"]

row_name = row_data["name"]

row_age = row_data["age"]

If the query executes successfully, the response is a dictionary containing the status and all cells with values.

{"status":true,"rows_index":[2,3],"quantity":2,"row_data":{"ID":2,"name":"John","age":"26","city":"New York"},"row":2}

status — the search result

rows_index — an array with the numbers of the found rows

row_data — data from the found row

row — the number of the found row

If an error occurs, the response will be status: false along with an error description: {"status": false, "error": "Error or description"}

Last updated