Add or change an ID-grid column
traceable_grid_columnAdd a column to an ID grid, rename one, or change one's type — pick with op. NON-DESTRUCTIVE in every case: existing cells and trace links are preserved (unlike traceable_segment_write, which replaces the whole grid and breaks links). Identify the grid by its HEADER row (header.itemId or header.atOrder). op=add gives every id-row a fresh cell: pass type, optionally insertAt (0-based position; omit to append) and label (omit for the type default ID / Link / Column). op=set_label renames a column's header text in place, leaving its type and cells alone: pass colIdx and label. Use it to correct a mislabeled header (e.g. a default "Column"). op=set_type converts each id-row cell to a new type: pass colIdx, type, and for typed columns config — { "options": ["Open","Closed"] } for a dropdown, { "op": "product", "sources": [1,2] } for a calculation. Only one id column is allowed per grid. To set a CELL's value use traceable_grid_cell.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | add a column, set_label to rename one, or set_type to convert one | |
| type | No | Column type (required for add and set_type) | |
| label | No | Header label (required for set_label; optional for add) | |
| colIdx | No | 0-based index of the column to act on (required for set_label and set_type) | |
| config | No | Per-column config (set_type only): dropdown {options:[…]} or calculation {op, sources:[colIdx…]} | |
| header | Yes | Identify the row by itemId or atOrder (pass one). | |
| insertAt | No | 0-based column position to insert at (add only; default: append) | |
| documentId | Yes | The document UUID |