Ask AI
English EN
Go to Watbot

A table in the chatbot

The bot can read a table: it finds the matching rows and sends them to the person as messages. The scenario has the "Read rows from a table" block for this. The block's settings are described on the Read rows from a table page; this page is about preparing the table itself.

The bot cannot write to a table, change or delete rows. If the scenario must save data — requests, answers, orders — use lists.

Which tables the bot sees

The block has the "Table" and "Sheet" settings. The bot reads only the tables of the bot's owner — from any of their projects, not only the one the bot is in.

How to prepare a table

  1. One row — one record. A product, a service, an address, a class in the schedule — each in its own row.
  2. The first row — headers. By default the block reads the sheet from the second row (the "Start searching the sheet from row" setting), so it is handy to label the columns in the first one: "Name", "Price", "Photo".
  3. Remember the column letters. In the block, values are inserted by column letter: {{ A }}, {{ B }}. The block does not use the names from the first row.
  4. Do not leave rows without data in the columns you need. The bot skips a row in which all columns from the message template are empty.

An example sheet for the "Daisy" flower shop:

A B C D
1 Name Price Category Photo
2 "Spring" bouquet 2500 bouquets https://example.com/vesna.jpg
3 Red rose 180 flowers https://example.com/rose.jpg

The message template in the block for such a sheet: {{ A }} — {{ B }} ₽.

A sheet for the bot: headers in the first row, photo links in column DA sheet for the bot: headers in the first row, photo links in column D

Photos and files

For the bot to send an image or a file, write a direct link to it in the cell — an address that starts with http:// or https://. In the block, a "Photo" or "File" part with the column letter is added for such a cell.

You cannot upload an image into the table itself: cells store only text.

Filtering and sorting

The block's "Filters" compare the value in a column with text, the person's reply, a contact variable or the contact's number ("Current contact"). "Sort" sets the column and the order.

Warning

All values in a table are text, and they are compared as text, character by character. Exact match (=) works reliably. "Greater than" and "less than" comparisons and sorting numbers of different length give unexpected results: "1000" comes before "250". If you need to compare and sort numbers or dates, keep the data in a list with fields of the right type.

To show a person only their own rows, create a column with the contact's number and add a "Current contact" filter on this column in the block.

How many rows the person sees

The block sends from 1 to 10 rows at a time and does not page further. If more rows match the conditions, the person sees only the first ones. Narrow the selection with filters or split the data across sheets — for example, by category.

If something does not work

  • The bot replies "No records found". No row matched the filters, all columns from the template are empty in the matching rows, or the table has been deleted. Also check that the data does not start above the row from the "Start searching the sheet from row" setting.
  • The bot replies "Table not set" or "Sheet not set". No table or sheet is selected in the block.
  • The bot replies "No templates found". The block's "Messages chain template" is empty.
  • Nothing arrives instead of a photo. The cell must contain a link starting with http:// or https://, with no extra text.