Skip to main content
add_column Add a new column (field) to an existing table. Its name must be unique within the table. Existing rows read the new column as empty; nothing is written to them. Column types: string, number, money, date, time, checkbox, select, multiSelect, email, url, phone, location, linkCell, oneMany, computed, reference, timer, approval, person, progress. For select/multiSelect: provide selectOptions (array of label strings). For oneMany (relation): provide linkedTableId. For progress: provide progress (mode, total, unit, display). For computed: create the column, then use set_computed separately.

Parameters

string
required
string
required
Column name, unique within the table.
string, enum: 'string' | 'number' | 'money' | 'date' | 'time' | 'checkbox' | 'select' | 'multiSelect' | 'email' | 'url' | 'phone' | 'location' | 'linkCell' | 'oneMany' | 'computed' | 'reference' | 'timer' | 'approval' | 'person' | 'progress'
default:"string"
array<string>
For select/multiSelect: the available option labels.
string
For oneMany: the _id of the table to link to.
object
For progress: what the column counts and how it is drawn. mode ‘percent’ reads a cell as a percentage out of 100; mode ‘unit’ reads it as a count out of total, named by unit (“steps”, “pages”, “claims”). Cells then take the figure: 3 for “3 / 10 steps”, 42 for “42%” — never more than the total; a figure past it is written as the total.