--- title: Introduction project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/introduction/ updated: 2026-11-20T06:39:57.622Z --- # Introduction > What Total.js Tables does and where to start. > **Note:** Total.js Tables is available only with a [Total.js Enterprise](https://www.totaljs.com/enterprise/) subscription. See the [Tables page](https://www.totaljs.com/tables/) on totaljs.com. Total.js Tables is a no-code tool for designing and managing database tables on top of PostgreSQL. You define your own tables and columns in the browser, link tables together, filter and sort records, and create or edit them in simple forms. Every table you design is a real PostgreSQL table, so other tools can read the same data. ![The Tables screen with the Sales tab open](/files/Jassl22Zv60f.webp) ## Words used in these pages - **Table**: a list of records with the columns you define, for example *Customers* or *Orders*. - **Column**: one field of a table, with a type such as Text, Number, Date or Dropdown. - **Record**: one row of a table, for example one customer. - **Relation**: a column of the type **Table** that points to a record in another table, for example the customer of an order. - **View**: a saved filter of a table with its own name and card. - **Tab** and **category**: the two levels that group the table cards on the main screen. ## What you need - A server with Node.js 18 or newer. - PostgreSQL 15 or newer, with an empty database for Tables. - The source code of Total.js Tables, which you get from Total.js with an Enterprise subscription. ## What to read next 1. [Install Tables](../install/) and [sign in for the first time](../first-sign-in/). 2. Learn the [main screen](../main-screen/). 3. [Create a table](../create-a-table/), add [columns](../columns/) and link tables with [relations](../relations/). 4. Work with data: [browse and filter](../browse-and-filter/), edit [records](../records/) and save [views](../views/). 5. Connect other systems with [API tokens](../api-tokens/), [hooks](../hooks/) and [actions](../actions/). --- title: Install Tables project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/install/ updated: 2026-11-20T06:39:57.622Z --- # Install Tables > Install Total.js Tables from its source code on a server with Node.js and PostgreSQL. > **Note:** Total.js Tables is available only with a [Total.js Enterprise](https://www.totaljs.com/enterprise/) subscription. See the [Tables page](https://www.totaljs.com/tables/) on totaljs.com. Tables is a Node.js application that keeps all its data in PostgreSQL. You install it from its source code. ## Get the code You get the source code of Total.js Tables from Total.js with a [Total.js Enterprise](https://www.totaljs.com/enterprise/) subscription. See the [Tables page](https://www.totaljs.com/tables/) on totaljs.com. Copy the folder of the app to your server, for example to `/www/tables/`. ## Prepare PostgreSQL Create an empty database and a user for Tables. For example, in `psql`: ```sql CREATE USER tables WITH PASSWORD 'choose-a-strong-password'; CREATE DATABASE tables OWNER tables; ``` You do not need to create any table. Tables creates its own tables the first time it starts. ## Install and configure **1.** Open a terminal in the folder of the app. **2.** Install the dependencies: ```bash npm install ``` **3.** Open the file `config` in the folder of the app and set the connection to your database and the address of the app: ```text database : postgresql://tables:choose-a-strong-password@localhost:5432/tables url : https://tables.yourdomain.com ``` All the keys of this file are in [Configuration](../../reference/configuration/). ## Start Tables Start the app: ```bash npm start ``` This runs `node index.js 8000`, so Tables listens on port 8000. To use another port, give the number to `index.js`: ```bash node index.js 8080 ``` Open `http://127.0.0.1:8000` in your browser. The first start creates the system tables in the database. Then continue with the [first sign-in](../first-sign-in/). To run Tables on a public server, read [Run Tables in production](../production/). --- title: First sign-in project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/first-sign-in/ updated: 2026-11-20T06:39:57.622Z --- # First sign-in > Sign in with the account that Tables creates at the first start, then change it. The first time Tables starts, it creates one administrator account with a random user name and a random password. ## Sign in 1. Open Tables in your browser. The sign-in page appears. 2. Until the first sign-in, the page shows a box called **Default account** with the generated **User name** and **Password**. 3. Click **Fill in the form** to copy them into the form, or type them. 4. Click **Sign in**. After the first successful sign-in, the sign-in page shows only the form. ## Change the account Change the generated name, user name and password right away: 1. Click your initials in the top right corner. 2. Choose **Change credentials**. 3. Enter your **Name**, a **Login** and a new **Password**. Leave the password field empty if you only want to change the name or the login. 4. Click **SUBMIT**. When you change the credentials, all the other open sessions are closed. To sign out, click your initials and choose **Logout**. If you lose the password, see [Installation and sign-in](../../faq/installation-and-sign-in/). --- title: The main screen project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/main-screen/ updated: 2026-11-20T06:39:57.622Z --- # The main screen > The parts of the Tables screen: tabs, categories, table cards and the toolbar. After you sign in, Tables shows all your tables as cards. ![The main screen with two tabs and three table cards](/files/Jassl22Zv60f.webp) ## Tabs and categories - The buttons at the top, here **Inventory** and **Sales**, are **tabs**. Each tab shows its own tables. - Inside a tab, the headings such as **Contacts** and **Orders** are **categories**. You set the tab and the category of each table in its settings. See [Create a table](../create-a-table/). ## Table cards Each card shows the icon, the name, the number of records in brackets and the description of a table. On a card: - Click the card to [browse the records](../browse-and-filter/). - Click **Add** to create a new record. - Click the three dots to open the menu of the table. ![The menu of a table card](/files/Jassl52cv61f.webp) The menu has these items: - **Browse data** opens the list of records. - **Add** creates a record. - **Import CSV** imports records from a file. See [Import a CSV file](../import-csv/). - **Export schema** downloads the structure of this table. See [Export, import and print the schema](../schema-files/). - **Clone** opens a new table form filled with the settings of this table. - **Settings** opens the [table settings](../table-settings/). - **Truncate data** and **Remove** are described in [Maintenance](../maintenance/). ## The toolbar - **Search** finds a table or a view by its name. Type a few letters and choose the table. - **Options** opens the menu for the whole database: **Create table**, **Export schema**, **Print schema**, **Import schema**, **Toggle diagram**, **Maintenance** and **Remove all tables**. - **Refresh** reloads the tables and their counts. ![The Options menu](/files/Jassl72dv60f.webp) ## The side bar The icons on the left switch between the tables (database icon) and the [API tokens](../api-tokens/). ## Windows Tables and records open in windows inside the page. You can move them, resize them, maximize them and minimize them. A minimized window appears as a button at the bottom of the screen; click it to bring the window back. --- title: Create a table project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/create-a-table/ updated: 2026-11-20T06:39:57.622Z --- # Create a table > Create a new table, give it a name, a place on the main screen and its columns. A table holds records of one kind, for example customers. Every table already has the columns **ID**, **Name**, **Created** and **Updated**. You add your own columns. ## Create the table **1.** Click **Options** and choose **Create table**. **2.** Fill in the top of the form: - **Pluralized name**: the name of the table, for example `Customers`. - **Singular**: the name of one record, for example `Customer`. Tables uses it in the title of a record and in buttons such as **Add Customer**. - **Tab** and **Category**: where the card appears on the main screen. Choose an existing one or type a new name. - **Color**, **Icon** and **Icon 2**: the look of the card. - **Description**: a short text shown on the card. **3.** Check the options you need. They are explained in [Table settings](../table-settings/). **4.** In the **Columns** tab, click **Add** to add each column. See [Columns](../columns/). **5.** Click **SUBMIT**. ![The table form](/files/Jasskl2Jv60f.webp) Tables creates the table in PostgreSQL and shows its card on the main screen. ## The Name column The **Name** column is the main text of each record. It is shown in bold in lists and used when another table links to this one. Click **Name** in the list of columns to rename it, for example to `Company` or `Subject`. ## Change a table later Open the three dots on the card and choose **Settings**, or click **Settings** in the list of records. The form is the same, titled **Update table**. The ID of the table, for example `t118h7`, is shown at the top. ## Copy a table configuration The **Copy** button at the top of the form copies the whole configuration of the table as text. In another table, **Paste** opens a window where you paste that text. Tables shows the differences between the two configurations; choose what to take and click **SUBMIT**. To create a new table from an existing one, use **Clone** in the menu of the card. --- title: Columns project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/columns/ updated: 2026-11-20T06:39:57.622Z --- # Columns > Add columns to a table, choose their type and set how they behave. Columns are the fields of a table. You manage them in the **Columns** tab of the [table form](../create-a-table/). ## Add a column 1. Open the settings of the table. 2. In the **Columns** tab, click **Add**. 3. Choose the **Type**, for example **Number** or **Dropdown**. All the types are in [Column types](../../reference/column-types/). 4. Enter the **Name**. 5. Click **SUBMIT** in the column window, then **SUBMIT** in the table form. ![The column form of a Number column](/files/Jasskd2Dv60f.webp) Each column gets an ID such as `x01`, `x02` and so on. This ID is the name of the column in PostgreSQL and in the [API](../../reference/api/). Keep the generated ID. ## Common options - **Required**: the record cannot be saved without a value. - **Read-only on user interface**: the value is shown but cannot be changed in the form. - **Hide on user interface**: the column is not shown. - **The user must enter a note when changing the value**: in a table with [versioning](../versions/), Tables asks for a note when someone changes this value. The note appears in the **Changelog** column of the versions. - **Allow cloning**: the value is copied when a record is cloned. - **Allow auto-complete**: for text columns, the form suggests values already used in the table. - **Help message**: a text shown under the field in the record detail. - **Note**: an internal note for you, shown in the list of columns. - **Error message**: the message shown when the value is invalid. - **Default value**: the value of a new record, written as a JavaScript expression, for example `'Spain'` or `0`. - **Group**: puts columns under a common heading in the form. ## Formatting In the **Formatting** tab of the column window: - **Format** adds text around the value. `{0}` is the value, so `{0} EUR` shows `250,00 EUR`. - **Decimals** sets the decimal places of numbers. - **Align**, **Listing width**, **Use monospace font**, **Color** and **Icon** change how the value looks. - **Transform** changes text to lower case, upper case or capitalized words when the record is saved. - **Dynamic formatting** colors the value when a condition is true. See [Conditional formatting](../conditional-formatting/). ## Where the column appears In the **Viewing** tab, **Show the column** decides where the column appears: in the listing, in the detail, in linked listings and details, and in the print. ## Order of the columns Drag the columns in the **Columns** tab to change their order in the form. The order in the list of records is set in the **Listing** tab; see [Table settings](../table-settings/). ## Change or remove a column Click a column to change it. The type can only be changed to a type that stores the same kind of data, for example from **Text** to **Email**. Click the trash icon to remove a column. Removing a column removes its data from the database when you submit the table form. --- title: Relations between tables project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/relations/ updated: 2026-11-20T06:39:57.622Z --- # Relations between tables > Link a record to a record of another table with a column of the type Table. A relation links two tables. For example, each order belongs to one customer. You create it with a column of the type **Table** in the table that points to the other one. ## Create a relation 1. Open the settings of the table that holds the link, for example *Orders*. 2. In the **Columns** tab, click **Add**. 3. Choose the type **Table**. 4. In **Table**, choose the table to link to, for example *Customers*. 5. Enter the **Name**, for example `Customer`. 6. Click **SUBMIT** in the column window and in the table form. In the list of orders, the **Customer** column shows the name of the linked customer. In the detail of an order, you choose the customer from a list. ## Options of a relation - **Render items in all related tables**: decides how the linked records appear in the detail of the other table. With **As list**, the detail of a customer shows a panel with the customer's orders. - **Show link button**: adds **Show more** under the value in the detail. Click it to open the linked record. - **Filter by**: limits which records can be chosen. ![The detail of a customer with the panel of its orders](/files/JasslK2ov61f.webp) ## See the relations **Options** > **Toggle diagram** shows all the tables and their relations. See [Diagram](../diagram/). --- title: Table settings project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/table-settings/ updated: 2026-11-20T06:39:57.622Z --- # Table settings > The options of a table: removal, versioning, cloning, favorites, sorting and the other tabs of the table form. Open the three dots on a card and choose **Settings** to change a table. Below the name and the look of the table, the form has a list of options and several tabs. ## Options - **Allow removal of documents from the user interface**: shows **Remove** in the list and in the detail. Uncheck it to stop records being removed from the screen. - **Show QR Code in detail**: shows a QR code of the record in its detail. - **Enable versioning**: keeps the previous values each time a record changes. See [Versions of a record](../versions/). - **Add to favorites**: marks the table as a favorite. - **Auto-close detail after saving**: closes the record window after **Save**. - **Allow cloning**: shows **Clone** in the **More** menu of a record. - **Prompt before closing with unsaved changes**: asks before closing a record that has unsaved changes. - **Stores deleted records for manual recovery or review**: keeps a copy of each removed record. See [Removed records](../removed-records/). ## Tabs of the form - **Columns**: the columns of the table. See [Columns](../columns/). - **Listing**: the default sort (**Sort by**) and the order of the columns in the list of records. Drag the columns to reorder them. - **Actions**: buttons that send a record to another system. See [Actions](../actions/). - **Hooks**: addresses that receive every new, changed and removed record. See [Hooks](../hooks/). - **Permissions**: limits the table to user groups. - **Formatting**: colors whole rows when a condition is true. See [Conditional formatting](../conditional-formatting/). - **Other**: **Custom attributes**, the **Thumbnail** column and the **Template** of the list. ## Show records as cards In the **Other** tab, **Template** changes how the list of records looks. **Default** is the table. **Cards** shows each record as a card with its values. ![The Products table shown with the Cards template](/files/JasslT2xv60f.webp) --- title: Conditional formatting project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/conditional-formatting/ updated: 2026-11-20T06:39:57.622Z --- # Conditional formatting > Color rows or values in the list of records when a condition is true. Conditional formatting highlights records, for example large orders or new orders. A rule has a condition and a style. ## Format whole rows 1. Open the settings of the table and go to the **Formatting** tab. 2. Click **Add**. 3. Enter an **Internal description**, for example `Large order`. 4. Enter the **Condition** in JavaScript. `row` is the record and its columns use their IDs, for example `row.x04 > 1000`. 5. Choose a **Font color**, a **Background color**, and **Bold**, **Italic**, **Underline** or **Strike**. 6. Click **Save**, then **SUBMIT**. ## Format one value 1. Open the column in the **Columns** tab. 2. In the **Formatting** tab of the column window, find **Dynamic formatting** and click **Add**. 3. Enter the description, the condition and the style. **Replace the value with text** shows a text instead of the value. 4. Click **Save**, then **SUBMIT** in both forms. In this list, the order of *Office chairs* is bold because its amount is over 1000, and the status **New** is red: ![The list of orders with a bold row and red statuses](/files/Jasskh2Gv61f.webp) ## Write conditions - Compare numbers: `row.x04 > 1000` - Compare a Dropdown value with its ID: `row.x05 === 'new'` - Combine conditions: `row.x04 > 100 && row.x05 === 'new'` The ID of each column is shown next to its name in the **Columns** tab. --- title: Calculated columns project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/sql-columns/ updated: 2026-11-20T06:39:57.622Z --- # Calculated columns > Show a value calculated by PostgreSQL from other columns with the SQL column type. A column of the type **SQL** shows a value that PostgreSQL calculates from the other columns of the record. It is read-only and is not stored; it is calculated each time the records are read. ## Add a calculated column **1.** Open the settings of the table and click **Add** in the **Columns** tab. **2.** Choose the type **SQL**. **3.** Enter the **Name**, for example `Stock value`. **4.** In **SQL expression**, write the calculation. Refer to the other columns with the `col.` alias and their IDs: ```sql col.x02 * col.x03 ``` **5.** Click **SUBMIT** in both forms. In a *Products* table where `x02` is the price and `x03` is the number in stock, this column shows the value of the stock of each product. Any expression that PostgreSQL accepts in a `SELECT` works, for example `UPPER(col.x01)` or `COALESCE(col.x04, 0) * 1.21`. --- title: Browse and filter records project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/browse-and-filter/ updated: 2026-11-20T06:39:57.622Z --- # Browse and filter records > Open the list of records of a table, filter, sort, page through it and export it to CSV. Click a table card to open the list of its records. ![The list of orders](/files/JasskX29v60f.webp) ## Toolbar - **Add** opens a form for a new record. - **Update** opens the selected record. Select a record with the checkbox at the start of its row. - **Remove** removes the selected records. - **Actions** shows **Create view** and your own [actions](../actions/). - **Refresh** reloads the list. - **Settings** opens the [table settings](../table-settings/). On the right, **Export to CSV** downloads the records, the magnifier finds a record by its ID, and the ID of the table is shown with a button to copy it. ## Open a record Click a row to open the record in its own window. See [Records](../records/). ## Filter Under each column heading there is a **Filter** field. Type a value and press Enter. The list shows only the records that match, and the field is highlighted. Click the red cross in the field to remove the filter. You can filter several columns at the same time. ![The list of orders filtered by customer](/files/JasskZ2Av61f.webp) To keep a filter, save it as a [view](../views/). ## Sort Click a column heading to sort by that column. Click again to reverse the order. The default order is set in the **Listing** tab of the [table settings](../table-settings/). ## Pages The list shows up to 100 records per page. Use the arrows at the bottom to move between pages. The number of records is shown at the bottom right. ## Export to CSV 1. Click **Export to CSV**. 2. Choose **Current page**, **Selected rows** or **All rows**. The browser downloads a CSV file with the columns of the list. --- title: Records project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/records/ updated: 2026-11-20T06:39:57.622Z --- # Records > Create, edit, clone, copy and remove records in the record window. A record opens in its own window. The fields are the columns of the table. ![The detail of an order](/files/JasslD2kv61f.webp) ## Create a record 1. Click **Add** on the table card or in the list. 2. Fill in the fields. Required fields have a red star. 3. Click **Save**. ## Edit a record 1. Open the record from the list. 2. Click a value to change it. For a Dropdown or a relation, choose the new value from the list. 3. Click **Save**. The button is enabled as soon as something changes. ![The detail of an order with the changed amount](/files/JasslG2lv60f.webp) At the bottom of the window, Tables shows who created and changed the record, when, and the **Revision** number, which grows with each change. ## The More menu - **Refresh** reloads the record. - **Print** prints the record. - **Share** copies a link to the record. The link opens Tables with this record. - **Versions** shows the previous values. It appears when the table has versioning. See [Versions of a record](../versions/). - **Copy data** copies the values of the record, and **Paste data** fills the form with copied values. - **Clone** opens a new record with the values of this one. ## Visibility The **Visibility** field limits a record to some users or groups. **No restrictions** means that everyone who can open the table sees the record. ## Remove a record Click **Remove** in the record window and confirm. To remove several records, select them in the list and click **Remove** there. If the table keeps removed records, see [Removed records](../removed-records/). --- title: Versions of a record project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/versions/ updated: 2026-11-20T06:39:57.622Z --- # Versions of a record > Keep the history of each record and restore a previous version. With versioning, Tables saves the previous values of a record every time it changes. ## Turn on versioning 1. Open the settings of the table. 2. Check **Enable versioning**. 3. Click **SUBMIT**. ## See the versions 1. Open a record. 2. Click **More** and choose **Versions**. ![The versions of an order](/files/JasslX30v61f.webp) Each row is one change: when it happened (**Created**), who made it (**User**), the note of the change (**Changelog**) and the values before the change (**Keys**). In this example, the amount was 1 250,50 before Jane Doe changed it. ## Restore a version 1. In the **Versions** window, click the row of the version you want. 2. Tables fills the record with those values and shows a message. 3. Click **Save** to keep them. If you close the record without saving, nothing changes. ## Ask for a note To ask the user for a note each time a value changes, open the column and check **The user must enter a note when changing the value**. The note is shown in the **Changelog** column. --- title: Removed records project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/removed-records/ updated: 2026-11-20T06:39:57.622Z --- # Removed records > Keep a copy of every removed record so you can review or recover it. By default, a removed record is gone. A table can instead keep a copy of each removed record. ## Keep removed records 1. Open the settings of the table. 2. Check **Stores deleted records for manual recovery or review**. 3. Click **SUBMIT**. From then on, each record removed from this table, from the screen or through the [API](../../reference/api/), is copied to the database table `tbl_removed` before it is removed. ## Review removed records The copies are not shown in the Tables screens. Read them in PostgreSQL. Each row has the ID of the record (`id`), the ID of its table (`tableid`), all the values in `data` (JSON), who removed it (`createdby`) and when (`dtcreated`): ```sql SELECT id, tableid, createdby, dtcreated, data FROM tbl_removed ORDER BY dtcreated DESC; ``` To recover a record, create it again with the values from `data`, for example by pasting them in a new record or by sending them to the API. ## Stop removal from the screen To stop users removing records at all, uncheck **Allow removal of documents from the user interface** in the table settings. --- title: Views project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/views/ updated: 2026-11-20T06:39:57.622Z --- # Views > Save a filtered list of a table as a view with its own card. A view is a saved filter of a table. It has its own card on the main screen, so you can open, for example, the orders of one customer with one click. ## Create a view 1. Open the list of the table. 2. Set the filters you want, for example `North` in the **Customer** column. 3. Click **Actions** and choose **Create view**. 4. Enter the **Name** of the view, for example `Northwind orders`. 5. Choose the **Tab**, the **Category**, the **Color**, the **Icon** and the **Description**. They start with the values of the table. 6. Under **Columns**, click the columns you do not want to show in the view. 7. Click **SUBMIT**. ![The form of a new view](/files/Jassla33v60f.webp) The view appears as a card next to the table, with a filter icon in its corner. Click it to see the records that match the saved filter. New records that match appear in the view automatically. ## Change or remove a view Open the three dots on the card of the view. **Settings** opens the form of the view, and **Remove** removes the view. Removing a view never removes records. --- title: Import a CSV file project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/import-csv/ updated: 2026-11-20T06:39:57.622Z --- # Import a CSV file > Import records from a CSV file into a table and map the file columns to the table columns. You can fill a table with records from a CSV file, for example a list exported from a spreadsheet. ## Prepare the file - The first line holds the names of the columns. - Use a comma or a semicolon between values. - If a column of the file has the same name as a column of the table, Tables maps it automatically. ```text Product,Code,Price,In stock Standing desk,DE-400,399.90,5 Monitor arm,MA-500,59,25 ``` ## Import 1. Open the three dots on the table card and choose **Import CSV**. 2. Choose the file. 3. Check the **Mapping**: each column of the table on the left gets a column of the file on the right. Click a value to change it, or leave `---` to skip a column. 4. Click **IMPORT DATA**. ![The Import CSV data window with the mapping](/files/Jasskx2Uv61f.webp) The window shows the **Total number of rows for import** before you start, and the number imported and the errors while it works. Wait until the import has finished. ## Options - **Stop importing when an error occurs**: stops at the first row that cannot be saved. - **Filter**: use it to update existing records. For a column that identifies a record, for example **Code**, click `---` and choose the column of the file with the same value. A row that matches an existing record updates it. Without a filter, every row creates a new record. - **Create a record if it doesn't exist**: with a filter, rows that match no record are skipped. Check this option to create them instead. --- title: Actions project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/actions/ updated: 2026-11-20T06:39:57.622Z --- # Actions > Add buttons that send a record to another system or to your own server code. An action is a button in the **Actions** menu of a table. When a user runs it, Tables sends the record to an address of another system, or to an action of an [extension](../../development/extensions/), and shows the answer. ## Add an action **1.** Open the settings of the table and go to the **Actions** tab. **2.** Click **Add**. **3.** Fill in the action: - **Name**: the text of the button, for example `Approve`. - **Endpoint**: a full address such as `https://erp.example.com/api/approve/`, or the name of a server action of an extension such as `Orders|approve`. - **Show**: **Everywhere**, **List** or **Detail**. - **Type**: **All**, **Create** or **Update**. - **Icon**: the icon of the button. **4.** Click **Save**, then **SUBMIT**. ## Run an action In the record window, the action is in the **Actions** menu at the start of the toolbar. An action of the type **Update** appears in the window of an existing record, **Create** in the window of a new record, and **All** in both. ![The Actions menu of an order with the Approve action](/files/JasskN21v60f.webp) In the list of records, open **Actions**. With no record selected, the menu shows the actions of the types **All** and **Create**. When records are selected, it shows the actions of the types **All** and **Update**, and runs the action once for each selected record. ## What the endpoint receives Tables sends a `POST` request with JSON to an address, or calls the server action directly. The data has the ID of the record, the table, the values and the user who ran the action. The full format is in [Hook and action data](../../reference/hook-and-action-data/). If the endpoint answers with a text, Tables shows it in a message. For example, an endpoint that answers `Order approved` shows that message to the user. --- title: Hooks project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/hooks/ updated: 2026-11-20T06:39:57.622Z --- # Hooks > Send every new, changed or removed record of a table to another system automatically. 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](/files/Jassku2Rv60f.webp) Leave a field empty to send nothing for that event. ## What the address receives Tables sends a `POST` request with a JSON body: ```json { "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](../../reference/hook-and-action-data/). Hooks run for records saved in the screens, through the [API](../../reference/api/) and by a [CSV import](../import-csv/). Tables does not wait for the answer of the hook, so a slow or failing address does not block the user. --- title: API tokens project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/api-tokens/ updated: 2026-11-20T06:39:57.622Z --- # API tokens > Create tokens that let other applications read and write your tables through the API. An API token lets another application or a script use Tables without signing in. Each token has a name, so you know which application uses it. ## Create a token 1. Click the API icon in the side bar on the left. 2. Click **Create**. 3. Enter the **App name**, for example `Demo integration`, and a **Summary** if you like. 4. Check **Super admin privileges** only if the application must change the structure of tables. Without it, the token can read and write records. 5. Click **SUBMIT**. ![The API Tokens screen with one token](/files/JasskQ24v61f.webp) ## Copy the token Open the three dots on the card of the token and choose **Copy token**. Keep the token secret, like a password. ## Use the token Send the token in the `x-token` header, or in the `token` parameter of the address. For example: ```bash curl -X POST https://tables.yourdomain.com/api/ \ -H 'x-token: YOUR_TOKEN' \ -H 'content-type: application/json' \ -d '{ "schema": "Tables|list" }' ``` All the calls are in [API](../../reference/api/). ## Block or remove a token - To stop a token for a while, open **Edit** and check **Ban token**. - To remove it for good, choose **Remove** in its menu. Records created with a token show the app name of the token as their creator. --- title: Export, import and print the schema project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/schema-files/ updated: 2026-11-20T06:39:57.622Z --- # Export, import and print the schema > Save the structure of your tables to a file, load it into another Tables, or print it. The schema is the structure of your tables: their settings, columns and views, without the records. You can save it to a JSON file, for example to copy your tables from a test server to the production server. ## Export the schema - For all tables: **Options** > **Export schema** > **All**. - For the tables of one tab: **Options** > **Export schema** > the name of the tab. - For one table: the three dots on its card > **Export schema**. Point at **Export schema** in the **Options** menu to open its submenu. The browser downloads a JSON file. When you export some tables, the file also contains the tables that they link to. ## Import a schema 1. Click **Options** and choose **Import schema**. 2. Choose the JSON file. Tables creates the tables and views of the file. A table that already exists with the same ID is updated with the settings of the file. Records are not imported; use [Import a CSV file](../import-csv/) for data. ## Print the schema **Options** > **Print schema** > **All** or the name of a tab opens a printable description of the tables and their columns. --- title: Diagram project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/diagram/ updated: 2026-11-20T06:39:57.622Z --- # Diagram > See all tables and the relations between them as a diagram. The diagram draws each table as a box and each [relation](../relations/) as a line between two tables. 1. Click **Options**. 2. Choose **Toggle diagram**. ![The diagram of the Customers, Orders and Products tables](/files/Jassko2Mv61f.webp) Drag a box to move it; Tables remembers its position. Click **Options** in a box to open the settings of that table. Choose **Toggle diagram** again to return to the cards. --- title: Maintenance project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/maintenance/ updated: 2026-11-20T06:39:57.622Z --- # Maintenance > Reload the structure, vacuum the database, empty a table, or remove tables. These tools are for administrators. Point at **Maintenance** in the **Options** menu to open its submenu. ## Reload structure **Options** > **Maintenance** > **Reload structure** checks every table and view in PostgreSQL against the settings of your tables and fixes the differences. Use it if the database was changed outside Tables or after restoring a backup. ## Vacuum **Options** > **Maintenance** > **Vacuum** runs `VACUUM FULL` on the database. It frees the space of removed and changed records. On a large database it can take a while and locks the tables, so run it when nobody is working. ## Truncate data The three dots on a card > **Truncate data** removes all the records of that table and keeps the table and its settings. Tables asks you to confirm twice. ## Remove a table The three dots on a card > **Remove** removes the table, its records and its views. Tables asks you to confirm twice. This cannot be undone, so [export the schema](../schema-files/) and back up the database first. ## Remove all tables **Options** > **Remove all tables** removes every table and its records. Tables asks you to confirm twice. --- title: Audit log project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/audit-log/ updated: 2026-11-20T06:39:57.622Z --- # Audit log > Record who created, changed or removed data and tables. The audit log records the changes that users and API tokens make: saved, cloned and removed records, and changes to tables and views. ## Turn on the audit log **1.** Open the file `config` of the app. **2.** Set `auditlogs` to `true`: ```text auditlogs : true ``` **3.** Restart Tables. ## Read the audit log Tables writes the log to the database table `tbl_log`. Read it with any PostgreSQL client: ```sql SELECT dtcreated, createdby, action, ip FROM tbl_log ORDER BY dtcreated DESC LIMIT 50; ``` `action` is the name of the operation, for example `Data|save` or `Tables|save`. `createdby` is the user or the app name of the API token. --- title: Run Tables in production project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/production/ updated: 2026-11-20T06:39:57.622Z --- # Run Tables in production > Keep Tables running on a server, protect it, and back up its data. Tables is a Node.js application. On a server, keep it running with a process manager and put it behind a web server with HTTPS. ## Keep it running Run the app with a process manager such as systemd or PM2, so it starts with the server and restarts after an error. The command is the same as by hand, run in the folder of the app: ```bash node index.js 8000 ``` To start the app in release mode, add `--release`: ```bash node index.js 8000 --release ``` ## Protect access - Change the generated account at the [first sign-in](../first-sign-in/). - Serve Tables over HTTPS, for example with nginx in front of it, and set `url` in the `config` file to the public address. - Do not open the PostgreSQL port to the internet. - Give each application its own [API token](../api-tokens/), and remove the tokens you do not use. ## Back up All your data is in PostgreSQL: the records, the settings of the tables, the views, the versions and the API tokens. Back up the database with your usual tool, for example: ```bash pg_dump --format=custom --file=tables.backup tables ``` Also keep a copy of the `config` file and of the folder `databases` in the app folder, which holds the account. --- title: Your account project: Tables version: 7.0 section: guides language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/guides/account/ updated: 2026-11-20T06:39:57.622Z --- # Your account > Change your name, login and password, and sign out. Tables has one built-in administrator account. Its menu is under your initials in the top right corner. ## Change credentials 1. Click your initials. 2. Choose **Change credentials**. 3. Change the **Name**, the **Login** or the **Password**. Keep the password field empty if you don't want to change it. 4. Click **SUBMIT**. The name appears in the records you create and change, and in the [versions](../versions/). When you change the credentials, all open sessions are closed except yours. ## Sign out Click your initials and choose **Logout**. --- title: Configuration project: Tables version: 7.0 section: reference language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/reference/configuration/ updated: 2026-11-20T06:40:02.622Z --- # Configuration > The keys of the config file of Total.js Tables. Tables reads its settings from the file `config` in the folder of the app. Each line is a key, a colon and a value. Lines that start with `//` are comments. Restart Tables after you change the file. ```text name : Tables url : https://tables.yourdomain.com database : postgresql://tables:password@localhost:5432/tables schema : public auditlogs : false ``` ## Keys | Key | Default | What it does | |---|---|---| | `database` | | The PostgreSQL connection string: `postgresql://user:password@host:port/database`. Required. | | `schema` | `public` | The PostgreSQL schema where Tables keeps its tables. If it does not exist, Tables creates it at the start. | | `url` | | The public address of the app, for example `https://tables.yourdomain.com`. | | `name` | `Tables` | The name of the app, shown in the top left corner and on the sign-in page. | | `icon` | `ti ti-database-alt` | The icon of the app, a Total.js icon class. | | `auditlogs` | `false` | `true` writes every change to the audit log. See [Audit log](../../guides/audit-log/). | | `$api` | `/api/` | The address of the API. Keep the default. | | `cdn` | `/cdn` | Where the browser loads the user interface libraries from. Keep the default. | --- title: Column types project: Tables version: 7.0 section: reference language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/reference/column-types/ updated: 2026-11-20T06:39:57.622Z --- # Column types > All the types of a column, what they store and how they are stored in PostgreSQL. Choose the type when you add a column. Later, a type can only be changed to another type with the same kind of data. See [Columns](../../guides/columns/). | Type | What it stores | PostgreSQL type | |---|---|---| | **Text** | A short text. | `TEXT` | | **Multiline** | A longer text on several lines. | `TEXT` | | **Name** | The name of a person. | `TEXT` | | **Number** | A number. **Decimals** in the formatting sets the decimal places. | `NUMERIC` | | **Auto increment** | A number that Tables fills in for each new record, in the format you set. | `TEXT` | | **Checkbox** | Yes or no. | `BOOLEAN` | | **Date** | A date. | `DATE` | | **Date + Time** | A date and a time. | `TIMESTAMP` | | **Dropdown** | One value from a list of items that you define. | `TEXT` | | **Radio button** | One value from a list of items, shown as radio buttons. | `TEXT` | | **Tags** | Several words. | `TEXT[]` | | **Email** | An email address, with a button to write to it. | `TEXT` | | **Phone** | A phone number, with a button to call it. | `TEXT` | | **URL address** | A web address. | `TEXT` | | **ZIP code** | A postal code. | `TEXT` | | **Color** | A color. | `TEXT` | | **Icon** | An icon. | `TEXT` | | **JSON** | JSON data. | `TEXT` | | **HTML content** | Formatted text. | `TEXT` | | **Password** | A password, stored as a hash, never as plain text. | `TEXT` | | **Secret** | A value hidden in the screens until you click **show**. | `TEXT` | | **International Article Number (EAN-13)** | A barcode number. | `TEXT` | | **Map position** | A position on a map. | `TEXT` | | **User** | A user name. | `TEXT` | | **File** | One uploaded file. | `JSON` | | **Attachments** | Several uploaded files. | `JSON` | | **Photo** | One image. | `JSON` | | **Gallery** | Several images. | `JSON` | | **Table** | A link to a record of another table. See [Relations](../../guides/relations/). | `TEXT` | | **SQL** | A value calculated by PostgreSQL, read-only. See [Calculated columns](../../guides/sql-columns/). | not stored | ## Dropdown and Radio button items Each item has a **Name**, and can have an ID, an icon and a color. Tables stores the ID of the chosen item. Use the ID in [conditions](../../guides/conditional-formatting/) and in the [API](../api/). ## Auto increment format The format builds the value from these parts: - `Y`: the year, for example `yyyy` gives `2026`. - `M`: the month. - `#`: the incremented number, padded with zeros to the number of `#`. - `{column}`: the value of another column. For example, `yyyy####` gives `20260001`, `20260002` and so on. ## Image settings For **File**, **Attachments**, **Photo** and **Gallery**, the column form has **Width** and **Height** for images, and **Disproportionate image width and height**. --- title: API project: Tables version: 7.0 section: reference language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/reference/api/ updated: 2026-11-20T06:39:57.622Z --- # API > Call Tables from other applications: the request format and the operations on tables and records. Other applications use Tables through one address, `/api/`. Every call is a `POST` request with a JSON body that names the operation in `schema` and its input in `data`. Authenticate with an [API token](../../guides/api-tokens/) in the `x-token` header or the `token` parameter. ```bash curl -X POST https://tables.yourdomain.com/api/ \ -H 'x-token: YOUR_TOKEN' \ -H 'content-type: application/json' \ -d '{ "schema": "Data|list", "data": { "tableid": "t588bi" } }' ``` ## IDs - Each table has an ID such as `t588bi`. It is shown in the list of records and in the table settings. - Each column has an ID such as `x01`. It is shown next to the column name in the table settings. The columns `id`, `name`, `dtcreated`, `dtupdated`, `createdby` and `updatedby` exist in every table. - Each record has an ID such as `JasodS1c561f`. ## Errors A failed call returns an array of errors, for example: ```json [{ "error": "401: Unauthorized" }] ``` ## Tables ### Tables|list Returns all tables and views with their settings and columns. No `data`. ### Tables|read Returns the settings of one table. `data`: `{ "id": "t588bi" }`. Only tokens with **Super admin privileges** can use it. ## Records ### Data|list Returns the records of a table or a view, 100 per page. ```json { "schema": "Data|list", "data": { "tableid": "t588bi" } } ``` The answer has `items`, `count`, `page`, `limit` and `pages`. To filter, sort and page, add parameters to the name of the operation, as in an address: ```json { "schema": "Data|list?x03=es&sort=name_desc&limit=20&page=2", "data": { "tableid": "t588bi" } } ``` - A column ID with a value filters by that column. - `sort` is a column ID followed by `_asc` or `_desc`. - `limit` is the number of records per page, up to 100. `page` is the page number. ### Data|read Returns one record with all its columns. `data`: `{ "tableid": "t118h7", "id": "JasodS1g561f" }`. For a relation column `x02`, `x02_id` is the ID of the linked record and `x02` holds its `id` and `name`. ### Data|id Finds the ID of the first record whose columns have the given values. ```json { "schema": "Data|id", "data": { "tableid": "t4193w", "filter": { "x01": "CH-100" } } } ``` Returns `{ "id": "JasooD1c561f" }`. ### Data|save Creates a record, or changes it when `data.data.id` is set. A new record must contain all its required columns; to change a record, send only the columns you want to change. For a relation, send the ID of the linked record; for a Dropdown, the ID of the item. ```json { "schema": "Data|save", "data": { "tableid": "t588bi", "data": { "name": "Example Ltd", "x01": "hello@example.com", "x03": "es" } } } ``` Returns `{ "success": true, "value": "" }`. Saving runs the [hooks](../../guides/hooks/) of the table and, with versioning, keeps the previous version. ### Data|remove Removes a record. `data`: `{ "tableid": "t588bi", "id": "" }`. ### Data|sql Runs a read-only SQL query and returns the rows. Only tokens with **Super admin privileges** can use it, and only one `SELECT` query is allowed. ```json { "schema": "Data|sql", "data": { "sql": "SELECT name, x04 FROM vt118h7 WHERE x04 > 100" } } ``` The tables and views you can query are described in [Database structure](../database/). ## Views ### Views|list Returns the views with their ID, table, name and icon. To read the records of a view, call `Data|list` with the ID of the view as `tableid`. --- title: Hook and action data project: Tables version: 7.0 section: reference language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/reference/hook-and-action-data/ updated: 2026-11-20T06:40:02.622Z --- # Hook and action data > The JSON that Tables sends to hooks and actions. Tables sends JSON in a `POST` request to the addresses of [hooks](../../guides/hooks/) and [actions](../../guides/actions/). ## Hooks ```json { "tableid": "t118h7", "app": "Tables", "user": { "id": "admin", "name": "Jane Doe", "groups": [] }, "data": { "id": "JasptJ1cg61f", "name": "Desk lamps", "rev": 1, "dtcreated": "2026-11-20T05:55:08.930Z", "dtupdated": null, "createdby": "Jane Doe", "updatedby": null, "x01": "20260006", "x02_id": "JasodS1c561f", "x02": "Northwind Supplies", "x04": 10, "x05": "new" } } ``` | Field | Content | |---|---| | `tableid` | The ID of the table. | | `app` | The `name` of the app from the config file. | | `user` | The user or API token that made the change. | | `data` | The record after the change. For a removed record, the record before it was removed. | In `data`, each column appears under its ID. For a relation column, `_id` is the ID of the linked record and `` its name. `rev` is the revision number of the record. ## Actions ```json { "id": "JasodS1g561f", "source": "detail", "tableid": "t118h7", "table": "Orders", "action": "update", "app": "Tables", "data": { "id": "JasodS1g561f", "name": "Office chairs", "x04": 1300 }, "user": { "id": "admin", "name": "Jane Doe", "sa": true, "groups": [] } } ``` | Field | Content | |---|---| | `id` | The ID of the record, empty for a new record. | | `source` | `detail` when run from the record window, `list` when run from the list. | | `tableid`, `table` | The ID and the name of the table. | | `action` | `update` for an existing record, `create` for a new one. | | `data` | The values of the record. | | `user` | The user who ran the action: `id`, `name`, `email`, `sa`, `groups`, `language` and `color`. | ## The answer - Hooks: Tables does not use the answer. - Actions: if the answer is a text, Tables shows it to the user in a message. --- title: Database structure project: Tables version: 7.0 section: reference language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/reference/database/ updated: 2026-11-20T06:40:02.622Z --- # Database structure > How Tables stores your tables in PostgreSQL, for reports and other tools. Every table you design is a real PostgreSQL table, so reporting tools and other applications can read your data directly. All the tables are in the schema set by `schema` in the [configuration](../configuration/). ## Your tables Each table is stored in a PostgreSQL table named with its ID, for example `t118h7`. Its columns are: | Column | Content | |---|---| | `id` | The ID of the record. | | `name` | The Name column. | | `x01`, `x02`, ... | Your columns, named with their IDs. | | `rev` | The revision number, raised on every change. | | `permissions` | The visibility of the record. | | `createdby`, `dtcreated` | Who created the record and when (UTC). | | `updatedby`, `dtupdated` | Who changed it last and when (UTC). | | `parentid`, `copyid`, `cloneid` | Internal links between records. | For each table, Tables also creates a view named `v` + the ID, for example `vt118h7`. The view adds the names of linked records and the [calculated columns](../../guides/sql-columns/). For reports, read the view: ```sql SELECT name, x02 AS customer, x04 AS amount FROM vt118h7 WHERE x05 = 'new' ORDER BY dtcreated DESC; ``` ## System tables | Table | Content | |---|---| | `tbl_table` | The settings and columns of each table. | | `tbl_view` | The saved views. | | `tbl_backup` | The [versions](../../guides/versions/) of records. | | `tbl_removed` | The [removed records](../../guides/removed-records/) of tables that keep them. | | `tbl_log` | The [audit log](../../guides/audit-log/). | | `tbl_token` | The [API tokens](../../guides/api-tokens/). | | `tbl_serial` | The counters of **Auto increment** columns. | | `tbl_file` | The uploaded files. | | `tbl_config` | Internal settings. | ## Change data safely Read freely, but change the structure of these tables only in Tables, never with SQL. Tables creates and changes the PostgreSQL tables and views from the settings of your tables. --- title: Build a customers and orders database project: Tables version: 7.0 section: recipes language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/recipes/customers-and-orders/ updated: 2026-11-20T06:39:57.622Z --- # Build a customers and orders database > Create two linked tables for customers and their orders, with order numbers and statuses. This recipe builds a small sales database: a *Customers* table and an *Orders* table where each order belongs to a customer. ## 1. Create the Customers table **1.** **Options** > **Create table**. **2.** **Pluralized name** `Customers`, **Singular** `Customer`, **Tab** `Sales`, **Category** `Contacts`. **3.** Click **Name** in the columns and rename it to `Company`. **4.** Add the columns: - `Email`, type **Email**. - `Phone`, type **Phone**. - `Country`, type **Dropdown**, with the items `Spain`, `Slovakia` and `Germany`. - `Active`, type **Checkbox**. **5.** Click **SUBMIT**. ## 2. Create the Orders table **1.** **Options** > **Create table**. **2.** **Pluralized name** `Orders`, **Singular** `Order`, **Tab** `Sales`, **Category** `Orders`. **3.** Rename **Name** to `Subject`. **4.** Add the columns: - `Number`, type **Auto increment**, format `yyyy####`. - `Customer`, type **Table**, table *Customers*. Check **Required** and **Show link button**, and set **Render items in all related tables** to **As list**. - `Order date`, type **Date**. - `Amount`, type **Number**, with **Decimals** `2` and **Format** `{0} EUR`. - `Status`, type **Dropdown**, with the items `New`, `Paid` and `Shipped`. **5.** Check **Enable versioning**, so every change of an order is kept. **6.** Click **SUBMIT**. ## 3. Add data 1. Click **Add** on the *Customers* card and create a few customers. 2. Click **Add** on the *Orders* card, choose a customer and save. Each order gets the next number, `20260001`, `20260002` and so on. The detail of a customer lists its orders. ## 4. Make it easier to read - In the **Formatting** tab of *Orders*, add the condition `row.x04 > 1000` with **Bold** to highlight large orders. Use the ID of your Amount column. See [Conditional formatting](../../guides/conditional-formatting/). - Filter the orders by a customer and save the filter as a [view](../../guides/views/). --- title: Send new orders to another system project: Tables version: 7.0 section: recipes language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/recipes/send-orders-to-another-system/ updated: 2026-11-20T06:39:57.622Z --- # Send new orders to another system > Use a hook to post every new order to the endpoint of another application. This recipe sends each new order to another application, for example an accounting system, as soon as it is saved. ## 1. Prepare the endpoint The other system needs an address that accepts a `POST` request with JSON, for example `https://erp.example.com/api/orders/`. It receives the format described in [Hook and action data](../../reference/hook-and-action-data/). A minimal receiver in Node.js that logs the order: ```js const http = require('http'); http.createServer(function(req, res) { let body = ''; req.on('data', chunk => body += chunk); req.on('end', function() { const hook = JSON.parse(body); console.log('New order', hook.data.name, 'for', hook.data.x02); res.end('OK'); }); }).listen(9000); ``` ## 2. Set the hook 1. Open the settings of the *Orders* table. 2. In the **Hooks** tab, enter the address in **Create**. 3. Click **SUBMIT**. ## 3. Try it Create an order. The other system receives the order with its number, customer, amount and status, and the name of the user who created it. To also send changes, enter the same address in **Update**. The receiver can tell new orders from changes by `dtupdated`, which is empty for a new record. --- title: Read and write data from a script project: Tables version: 7.0 section: recipes language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/recipes/read-data-from-a-script/ updated: 2026-11-20T06:39:57.622Z --- # Read and write data from a script > Use an API token to list, find and create records from a shell script or another application. This recipe uses the [API](../../reference/api/) with `curl`. The same requests work from any language. ## 1. Create a token Create an [API token](../../guides/api-tokens/) named after your script, and copy it. In the examples, it is in the variable `TOKEN`, and the table IDs are those of your own tables: ```bash TOKEN='paste-your-token-here' URL='https://tables.yourdomain.com/api/' ``` ## 2. List customers from Spain ```bash curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \ -d '{ "schema": "Data|list?x03=es&sort=name_asc", "data": { "tableid": "t588bi" } }' ``` ## 3. Find a record by a value ```bash curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \ -d '{ "schema": "Data|id", "data": { "tableid": "t4193w", "filter": { "x01": "CH-100" } } }' ``` ## 4. Create a record ```bash curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \ -d '{ "schema": "Data|save", "data": { "tableid": "t588bi", "data": { "name": "Example Ltd", "x01": "hello@example.com" } } }' ``` The answer has the ID of the new record in `value`. ## 5. Update it Send the ID in `data.data.id` and only the columns to change: ```bash curl -s -X POST "$URL" -H "x-token: $TOKEN" -H 'content-type: application/json' \ -d '{ "schema": "Data|save", "data": { "tableid": "t588bi", "data": { "id": "RECORD_ID", "x04": false } } }' ``` --- title: Make a sales report with SQL project: Tables version: 7.0 section: recipes language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/recipes/sales-report-with-sql/ updated: 2026-11-20T06:39:57.622Z --- # Make a sales report with SQL > Sum the orders of each customer with a SQL query on the view of the Orders table. Because every table is a PostgreSQL table, you can make reports with SQL. This recipe sums the orders of each customer. ## The query The view `v` + table ID has the name of the linked customer in the relation column. With *Orders* = `t118h7`, `x02` = Customer and `x04` = Amount: ```sql SELECT x02 AS customer, COUNT(*) AS orders, SUM(x04) AS total FROM vt118h7 GROUP BY x02 ORDER BY total DESC; ``` ## Run it - In any PostgreSQL client connected to the database of Tables, for example `psql` or a reporting tool. - Or through the API with a token that has **Super admin privileges**: ```bash curl -s -X POST https://tables.yourdomain.com/api/ -H 'x-token: YOUR_TOKEN' -H 'content-type: application/json' \ -d '{ "schema": "Data|sql", "data": { "sql": "SELECT x02 AS customer, SUM(x04) AS total FROM vt118h7 GROUP BY x02" } }' ``` The structure of the tables and views is in [Database structure](../../reference/database/). --- title: Installation and sign-in project: Tables version: 7.0 section: faq language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/faq/installation-and-sign-in/ updated: 2026-11-20T06:39:52.622Z --- # Installation and sign-in > Answers about installing Tables and signing in. ## Where do I find the first password? On the sign-in page, in the **Default account** box, until the first successful sign-in. See [First sign-in](../../guides/first-sign-in/). ## I lost the password. How do I get in? 1. Stop Tables. 2. In the folder of the app, remove the file `databases/memorize_account.json`. 3. Start Tables. It creates a new account and shows it on the sign-in page. Your tables and records are not touched; they are in PostgreSQL. ## Do I need to create the tables in PostgreSQL? No. Create only an empty database. Tables creates its system tables at the first start, and a PostgreSQL table for each table you design. ## Which port does Tables use? `npm start` uses port 8000. Start it with `node index.js` and another number to use another port. See [Install Tables](../../guides/install/). --- title: Tables and data project: Tables version: 7.0 section: faq language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/faq/tables-and-data/ updated: 2026-11-20T06:39:52.622Z --- # Tables and data > Answers about designing tables, changing columns and keeping data. ## Can I change the type of a column? Only to a type that stores the same kind of data, for example from **Text** to **Email** or **Multiline**. To change a text into a number, add a new Number column and copy the values. ## Where is my data? In PostgreSQL. Each table is a PostgreSQL table named with its ID, for example `t118h7`. See [Database structure](../../reference/database/). ## How do I back up Tables? Back up the PostgreSQL database, for example with `pg_dump`, and keep a copy of the `config` file. See [Run Tables in production](../../guides/production/). ## Can I undo a change to a record? Yes, if the table has **Enable versioning**. Open the record, choose **More** > **Versions** and click the version to restore. See [Versions of a record](../../guides/versions/). ## Can I get back a removed record? Only if the table has **Stores deleted records for manual recovery or review**. The copy is in the database table `tbl_removed`. See [Removed records](../../guides/removed-records/). ## How do I move my tables to another server? Export the schema on the first server and import it on the second. Then move the records with CSV files or by copying the database. See [Export, import and print the schema](../../guides/schema-files/). ## Why is a calculated column empty? Check the SQL expression of the column. It must refer to the other columns with `col.` and their IDs, for example `col.x02 * col.x03`. See [Calculated columns](../../guides/sql-columns/). --- title: Extensions project: Tables version: 7.0 section: development language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/development/extensions/ updated: 2026-11-20T06:39:52.622Z --- # Extensions > Add your own server code and buttons to Tables with extension files. An extension is an HTML file that adds your own code to Tables: server code, for example an action that an [action button](../../guides/actions/) calls, and browser code, for example a button in the record window. ## Where extensions live 1. Create a folder named `extensions` in the folder of the app. 2. Put your extension files in it, for example `extensions/orders.html`. 3. Restart Tables. It loads every `.html` file of the folder at the start. Files whose name contains `-bk` or `_bk` are skipped, so you can keep a disabled copy next to the active one. ## The parts of an extension file An extension has up to two parts: - ` ``` The button appears at the end of the fields of each record. Clicking it sends the values of the record to the server action, which answers with a text: ![A record with the Say hello button added by an extension](/files/JasskG1uv61f.webp) ## React to saved records Server code can listen to the operations of Tables. Put `@` before the name of the operation: ```html ``` ## Call your action from an action button A server action of an extension can be the **Endpoint** of an [action](../../guides/actions/): enter its name, for example `Orders|approve`, instead of an address. The action receives the data described in [Hook and action data](../../reference/hook-and-action-data/), and the text it returns is shown to the user. ```html ``` All the events and helpers are in [Extension reference](../extension-reference/). --- title: Extension reference project: Tables version: 7.0 section: development language: en license: Total.js Enterprise url: https://totaljs.es/docs/tables/7-0/development/extension-reference/ updated: 2026-11-20T06:51:57.969Z --- # Extension reference > The browser events, the helpers of the record window and the server events that extensions use. Extensions use these events and helpers. Browser events are registered in the `