Tables
A table holds records. It always lives inside one model, and its shape is defined by the attributes you create on it.
Think of a table as a sheet in a workbook, or a table in a database.
Structure
Section titled “Structure”| Field | Description | Required |
|---|---|---|
| Name | The name of the table | Yes |
| Description | Free text | No |
| Use this as a reference table | Whether identifier/display name are required and the table can be referenced by others (API name: code_generation, AUTO or MANUAL) |
No (defaults to off / AUTO) |
| Identifier column name | Only shown when the reference table switch is on | Yes, when it is on (defaults to Code) |
| Display name column name | Only shown when the reference table switch is on | Yes, when it is on (defaults to Name) |
| Tags | Any number of tags | No |
Each table receives a source_id (UUID) that identifies it permanently.
The built-in fields: identifier and display name
Section titled “The built-in fields: identifier and display name”Every table has two fields that you can neither create nor delete: an identifier
attribute and a display name attribute. By default they are named Code and Name, but
when creating a reference table you can choose different names — for example ISOCode and
CurrencyName. Standard tables start with Code and Name. You can rename either attribute
later from Edit Attributes.
- Identifier — a short, stable business key, for example
SEKor1200. - Display name — a readable label, for example
Swedish krona.
They exist so that a record can be presented to a human as SEK - Swedish krona. This
matters most when the table is used as a reference table.
Reference tables
Section titled “Reference tables”In the app this is a single switch: Use this as a reference table. Behind the scenes it
sets the table’s code generation to MANUAL (the technical name you may see in the API).
Standard table (AUTO) |
Reference table (MANUAL) |
|
|---|---|---|
| Identifier is supplied by | Grunddata | You |
| Identifier required on every record | No | Yes |
| Display name required on every record | No | Yes |
| Identifier / display name visible in forms and grids | No | Yes |
| Can be referenced by other tables | No | Yes |
| Typical use | Data and transactional tables | Lookups and reference lists |
Create a table
Section titled “Create a table”-
Go to Models and open the model the table belongs to. If you have no model yet, create one first.
-
Click Create Table.
-
Fill in the name and an optional description.
-
Decide whether this is a reference table. If it is, choose the names for the identifier and display name columns (defaults:
CodeandName). -
Add any tags, then click Create.
You can also see every table across every model from the top-level Tables page — useful when you know the table name but not which model it is in.
The table overview
Section titled “The table overview”Opening a table gives you its overview page, which is the hub for everything about it:
- Attributes — the columns, with counts of required and domain attributes.
- Records — the data grid, with add, edit and delete.
- Views — the OData contracts built from this table.
- Recent commits — who changed what, and when.
- Edit Table — change name, description and tags.
- Delete Table — remove the table, when nothing references it.
Update a table
Section titled “Update a table”From the table overview click Edit Table, or use the pencil icon in a table listing. You can change the name, description and tags.
Delete a table
Section titled “Delete a table”From the table overview click Delete Table, or use the trash icon in a table listing, and confirm.
Deleting a model soft-deletes all its tables and views together, while retaining the records. The confirmation shows how many tables and views will be affected and lists any external formula or domain-attribute references that must be removed before the model can be deleted.