Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.retailgrid.io/llms.txt

Use this file to discover all available pages before exploring further.

Custom columns let you extend a workbook grid with your own data fields. You can add them manually, edit cell values inline, and choose how each column stores and displays its data.

Adding a custom column

Click Add Column in the workbook toolbar to open the column stepper. The stepper walks you through two steps:
  1. Select a column type — choose from Text, Number, Currency, or Formula.
  2. Configure the column — set a name and any type-specific options, then click Add Column.
The new column appears immediately in the grid.

Column types

Typecolumn_type valueDescription
Textcustom_textPlain text field. Values are stored as strings.
Numbercustom_numberNumeric field. Values are stored as numbers.
Currencycustom_currencyNumeric field displayed with $ formatting.
Formulacustom_formulaDynamically computed from other columns.

Formula columns

Formula columns reference other column values using expressions and display the result according to a Display Format you pick during setup:
Formatterformatter valueBehavior
TexttextResult is rendered as plain text.
NumbernumberResult is rendered as a number.
CurrencycurrencyResult is rendered with $ formatting.
Grouping and aggregation are not available for formula columns.

Editing cell values

Custom columns are editable directly in the grid. Click a cell and type to update its value. Press Enter to confirm and move to the next row. Retailgrid validates the value against the column’s storage type before saving:
Storage typeAccepted valuesRejected values
stringText, null
numericNumbers, numeric strings, nullBooleans
integerIntegers, integer strings, nullBooleans, floats with a fractional part
booleantrue/false, "true"/"1"/"yes", null
If the value cannot be coerced to the expected type, the API returns a 422 error and the cell reverts to its previous value. Clearing a cell (leaving it empty) stores null for all column types.

API reference

Add a custom column

POST /workbooks/{workbook_id}/columns/add-custom
Request body
{
  "name": "Margin",
  "column_type": "custom_formula",
  "formatter": "currency"
}
FieldTypeRequiredDescription
namestringNoColumn label. Defaults to "Custom".
column_typestringNoOne of custom_text, custom_number, custom_currency, custom_formula. Defaults to custom_text.
formatterstringNoDisplay format for custom_formula columns: text, number, or currency. Defaults to text.
Response
{
  "column_id": 42,
  "column_key": "dyn:a1b2c3d4e5f6",
  "column_name": "Margin",
  "unique_id": "dyn:42",
  "type": "custom_formula",
  "formatter": "currency"
}

Set a cell value

PUT /workbooks/{workbook_id}/data/cells
Request body
{
  "row_id": 101,
  "column_id": 42,
  "value": 19.99
}
FieldTypeRequiredDescription
row_idintegerYesMust be greater than 0.
column_idintegerYesMust be greater than 0.
valuestring | number | boolean | nullYesThe new cell value. Pass null to clear the cell.
Errors
StatusCause
404Column not found in this workbook.
422Value cannot be coerced to the column’s storage type (e.g. passing a boolean to a numeric column).