Spanish Total.js
Slovenčina
Dokumentácia Pre AI agentov
Obsah

Hooks

Send every new, changed or removed record of a table to another system automatically.

.md Web

Táto stránka ešte nie je preložená. Čítaš originál.

Na tejto stránke

A hook is an address that Tables calls automatically when a record changes. Use it to keep another system up to date, for example to send every new order to an accounting system.

Set up hooks

1. Open the settings of the table and go to the Hooks tab.

2. Enter the addresses:

  • Create: called after a new record is saved.
  • Update: called after a record is changed.
  • Delete: called after a record is removed.

3. Click SUBMIT.

The Hooks tab of a table

Leave a field empty to send nothing for that event.

What the address receives

Tables sends a POST request with a JSON body:

{
    "tableid": "t118h7",
    "app": "Tables",
    "user": { "id": "admin", "name": "Jane Doe" },
    "data": {
        "id": "JasodS1g561f",
        "name": "Office chairs",
        "x02_id": "JasodS1c561f",
        "x02": "Northwind Supplies",
        "x04": 1300,
        "x05": "paid"
    }
}

data holds the whole record as it is stored, with the values of all its columns. For a relation, x02_id is the ID of the linked record and x02 its name. The full format is in Hook and action data.

Hooks run for records saved in the screens, through the API and by a CSV import. Tables does not wait for the answer of the hook, so a slow or failing address does not block the user.

Vyrobené v Európe