Create a data table
5 min read
You need an administrator account and a plan that includes data tables (see the overview).
The Data Tables list
Open WPM Fields › Data Tables. The list has one line per table:
Column | Meaning |
|---|---|
Name | The name you gave the table. |
Key | The identifier, in a monospace font. |
Columns | How many columns the table has. |
Rows | How many rows it holds. |
Used by | What depends on the table (tasks, forms, connections), or a dash. |
Actions | Edit and Delete. |
With no tables the screen says No data tables yet: "Create a table, define its columns, then add rows by hand, import a CSV file or connect a form." Click Add data table.
Add a table
- Click Add data table. The New data table screen opens: "Each column is a field with its own type and database column; each row is one record."
- Fill in the table details:
Setting | Notes |
|---|---|
Name (required) | For you, for example |
Key (required) | Filled in from the name as you type ( |
Description | Optional note for you. |
The key must start with a letter and use only lowercase letters, numbers and underscores, 63 characters at most. The key field itself drops other characters while you type. Through the API a key such as Bad Key is refused (400, "key does not match pattern").
- Under Columns, click Add field and add the columns one by one. This is the same builder you know from field groups, see Add and arrange fields. A table builder differs in three ways:
- only the types listed in the overview are offered;
- each column's Advanced options has the Type settings (when the type has some, for example Allowed file types of a File column), General and Validation tabs, but no Display and no Conditional logic tabs;
- the limit is 100 columns ("Maximum column limit reached.").
- Click Create data table. A toast says "Data table created. Add rows or import your data next." and the table opens on its Entries tab.
If you click Create data table with a missing name or key, or a column without a label or key, the editor shows the message next to the field ("Enter a name for the data table.", "Enter a key.", "Each column needs a label.") and does not save.
A table can be created with no column at all and filled later. Until it has columns, the Entries and Import & feed tabs say Add columns first.
Column keys
A column key follows the same rules as a field key: it starts with a letter, uses lowercase letters, numbers and underscores, and may not be an SQL reserved word (order, group, key, rows, where, index, match ...) or a system name (id, mid, mtype, wpid, uid, created_at, updated_at, ai_context, omit_delivery). The editor tells you when a key is refused.
Unique columns: the key for updating rows
To update existing rows during an import, a feed sync or a form connection, a column must be unique:
- Open the column's Advanced options, tab Validation.
- Turn on Unique (this also turns on Add index).
The help text of the Columns card says: "Mark a column "Unique" (in its advanced settings) to update existing rows when importing." A unique column also stops two rows from holding the same value: adding a second row with SKU-1 fails with A row with this value already exists. and an import counts that row as failed. Turning Unique on for a column that already holds duplicates fails and nothing is saved (see Changing a field group safely, which applies to tables as well).
The four tabs of an existing table
When you open a table you see the tabs Entries, Columns, Import & feed and Settings. A new table opens on Entries (or Columns while it has no column).
Tab | Purpose |
|---|---|
Entries | The rows: browse, search and edit, plus Download CSV. |
Columns | Name, description and the column builder. |
Import & feed | CSV import and the data feed. |
Settings | Public columns: which columns the site may show. |
The tab you are on is kept in the address (#tables/{key}/entries, .../columns, .../import, .../settings), so you can reload or bookmark it.
Change the columns later
- Open the table, go to the Columns tab.
- Add, rename, reorder, retype or remove columns.
- Click Save columns (the button appears while there is something to save).
While you have unsaved column changes the other tabs show Save your column changes first.
Changing columns changes the real database table, with the same safety rules as field groups: see Changing a field group safely and Table health. In particular:
- A column you remove is not dropped silently. Its data stays in the database as an orphan column.
- If you add a column whose key matches an orphan column, saving is refused: "These names still hold data from removed columns: x, y. Remove the old columns under Schema first, or choose other names." Pick another key, or clear the orphan columns first.
- Saving can end with warnings (for example about the number of indexes); they are shown as warning toasts.
Settings: public columns
On the Settings tab, Public columns chooses which columns the website may show: "Only these columns can be shown on your site: in row lists and as choices of form fields. Everything else stays in the admin. Password columns are never shown."
- Tick the columns (each is shown with its label and key). Password columns are greyed out and cannot be ticked.
- Click Save settings ("Settings saved.").
Nothing is public by default. Public columns are used by:
- the site list (shortcode and block): it can show, filter and sort by public columns only;
- choice fields of connected forms: label and value must be public columns.
When you remove a column or change it to a Password column, it is dropped from the public list automatically.
Delete a table
- In the list, click Delete on the table.
- Confirm Delete data table? The table and all its rows are deleted for good.
If something still uses the table, the delete is refused (see "What a table is used by" in the overview). Export the rows first if you may need them (Export to CSV).
Still stuck? Contact support