Tables define the structure for an Smartmate app to store data. Each table should be defined in it’s own YAML file.

Each table has fields and permissions, among other properties.

You can connect multiple tables using relationship fields and table fields.

How tables work

Each table is defined by a table YAML file. When the workspace is published, Smartmate will create these tables in the workspace database.

Data in a table can be inserted, modified or deleted in two ways:

  1. By a process: A process can add or modify information. The process needs to be connected to a table through the mainTable property. See the process documentation for more information.

  2. By a user: A user with proper table permissions, can add, modify or delete data directly.

The first way ensures that data is entered following a structured process. The second way makes the system flexible, it allows users to enter data that does not fit into a structured process, exceptions, or corrections.

Adding a table

You can add tables to an app, using the cli command sm add table from within an app folder. The CLI will ask you a few questions and create a YAML file that defines the table.

You can always edit the YAML file. After making any changes, you can run sm validate to validate them.