Creating a Lookup Table
Create a lookup table to hold key-value reference data that workflows read, or a data table to hold records that workflows write. You define the columns when you create the table; rows come later, after you publish the table to an environment.
Before you begin
- You need permission to create lookup tables.
- For a lookup table, plan at least one key column. The key columns identify a row, and their order forms the row key.
Create a table from scratch
- In the left toolbar, select Tables.
- Select Add Table, then select Create Table.
- Select Lookup Table or Data Table.
- Enter a Name: letters, numbers, and single spaces, up to 50 characters, unique among tables of the same kind.
- Optionally, enter a Description of up to 200 characters.
- Set the storage option:
- For a lookup table, under Row encryption, select Secure columns to encrypt only the columns marked Secure, or All columns to also encrypt the complete record.
- For a data table, enter the Time to live: how long, in minutes, rows are kept before they expire. It must be between 10 and 2160 minutes.
- Select Next.
- In Configure name, add the columns. For each column, set:
- Name: letters and numbers only. Workflows read and write the column by this name.
- Type: String, Number, Boolean, or Integer.
- Key: select for the columns that identify a row.
- List: select if the column holds a list of values instead of one. Not available on key columns.
- Secure: select to encrypt the column's values in storage and hide them in Studio, workflow logs, and exports. Workflows can still read the values.
- Description: optional.
- Select Create.
Create a table from a CSV or JSON file
- In the left toolbar, select Tables.
- Select Add Table, then select Import Table.
- Select Lookup Table or Data Table.
- Enter a Name and, optionally, a Description. For a data table, enter the Time to Live (in mins).
- Select or drag a file into the upload area. You can use:
- A CSV file. The first row is used as the header.
- A JSON file exported from a table of the same kind, including a definition exported with Export > Definition — columns and keys.
- Select Next.
- Review the columns in Configure name and change them if needed. Only the columns are imported; rows in the file are not saved.
- Select Create.
Rename a table
- Select the table in the Tables panel.
- In the editor header, hover over the table name and select the edit icon. You can also select Rename in the table's menu in the list.
- Enter the new name and press Enter. Press Esc to cancel.
Studio checks for references first. If workflows or other items reference the table, a Rename name? dialog lists them. Select Rename to update their references. Deployed workflows keep the old name until you redeploy them. Existing rows are kept.
How you know it worked
The new table opens in the editor as a draft, and it appears in the Lookup or Data tab of the Tables panel. After an import, Studio shows "Lookup table name created." or "Data table name created."
The table has no rows yet. Publish it to Development to make it available to workflows, then import rows into a lookup table. Workflows write a data table's rows at runtime.
When it does not work
| Symptom | Cause | What to do |
|---|---|---|
| "A lookup table named "name" already exists. Use a different name." | Another table of the same kind has that name. A lookup table and a data table can share a name. | Use a different name. |
| "At least one primary key and one non-primary key column must be added." | The lookup table has no key column, or only key columns. | Mark at least one key column and add at least one value column. |
| A data table shows "No key column selected. A system-generated key is used, so rows can't be updated in place." | No column is marked Key. | Mark a key column if workflows need to update rows. |
| "Time to live must be at least 10 minutes." | The time to live is below the minimum. | Enter a value between 10 and 2160. |
| Secure is unavailable with "Secure storage is off for data tables in this workspace." | Secure storage is not enabled for data tables. | Leave Secure off, or ask an administrator to enable secure storage. |
| "The file belongs to a different table type. Lookup and data-table definitions cannot be mixed." | The JSON file was exported from the other table kind. | Import it as the other kind, or use a matching file. |
| "The CSV file has no header row. Add one and upload the file again." | The CSV file is empty or has no header. | Add a header row. |
| A rename fails with "This table has been deployed, so its name can't be changed." | The server does not allow renaming this deployed table. | Keep the name, or create a new table. |