Bot flows can write to your tables, read from them, and start on their own when a record is added or changes. That way you take an appointment in the chat, save it to a table and let the customer know when its status changes. There are two parts: the Table step inside a flow and the Tables trigger at the start.
The Table step
In the flow editor, add the Table step from the Flow group of the palette. Choose the Table, then the Action:
| Action | What it does |
|---|---|
| Add record | What it doesAdds a new row. The new record can be saved to a variable. |
| Find records | What it doesReturns the records matching the conditions. With Maximum records at 1 you get the record itself; with more, a list and the total. |
| Update record | What it doesChanges only the fields you fill in on the chosen record. |
| Update or add | What it doesLooks up a record by the Match field; updates it if found, otherwise adds it. The match field must be Unique in the schema. |
| Delete record | What it doesDeletes the chosen record or the records matching the conditions. |
| Count records | What it doesReturns how many records match (e.g. “how many appointments at this time”). |
- Values to write: each row picks a field and its value. Values can contain variables such as
{{var_local.name}}; options can be written by their label. Add required field adds the missing required fields at once. - Contact in this chat: on contact fields, this button links the record to the person the flow is talking to. The record then shows in their conversation panel.
- Conditions: choose which records find, count, update and delete work on. For comparisons that take several values, separate them with commas.
- Which record (update and delete): By record ID takes the variable of an earlier table step; Matching a condition selects by condition. With All matching records on, up to 100 records are affected.
- Save result: the result goes into this variable; use it in later steps as
{{var_local.record.field}}.
Example: booking an appointment in the chat
- Ask for the name with Ask for text and the day with Ask for date.
- In a Table step choose Count records with the date field equal to the requested day. Save the result to a variable.
- Use a Condition step to suggest another day if the count isn’t zero.
- Otherwise use a Table step with Add record: name, date and Contact in this chat for the contact field. Then send a confirmation.
Starting a flow when a record changes
- In the flow’s start step, open What starts the flow and choose When a table record is added or changed from the Tables source.
- Choose the Table and When: A record is added, A record is updated or both. For updates, When these fields change lets you react only to certain fields (e.g. Status).
- Optionally use Conditions to start only for certain records (e.g. status “Approved”).
- Under Who gets the messages, choose The number in the received data and pick
contact.phone: messages go to the contact in the record’s contact field. - Publish the flow. Records written by the flow itself don’t restart it.
If the contact came from WhatsApp, the message goes out on WhatsApp; if from Instagram or Messenger, it goes out there. On WhatsApp, the first message of a conversation the contact didn’t start must be an approved template; Instagram and Messenger only allow messages within 24 hours of the contact’s last message.
The trigger data carries the record’s fields under record (record.id, record.status…), the event type in event and the changed fields in changedFields. Save the record to a variable keeps all of it in one variable.