Update Sheet Field
sheet.update_attributeUpdate an existing attribute (field) on a sheet. Pass only what changes. Call sheet.schema first for the field's id, its live option ids, its current default and its archived choices.
Basics:
name,description,icon,dataType,isUnique(Title, Short Text, URL, Phone Number, Email; on a field that already holds duplicates it fails with UNIQUE_HAS_DUPLICATES and nothing changes, so ask the user to remove them first), anddefault, the value new rows start with (choices, members, teams, jobs, Date).Format:
number(format such as Euro or Dollar,decimals,showAs),date(dateFormat,timeFormat),checkboxStyle,selectStyle,language(Code), andrelationon a Relation field:subtitle(a related field shown under each link),viewandform(by name, of the related sheet),filter(which related rows can be picked, in sheet.read'sfiltersshape). Underoptions:formula/returnType(Formula),relation/field/function(Mirror, Rollup),stars(Rate, 2–20),workflow(Button, by name),template(Summary),allowedFiles(any / images / documents / media / custom),allowedExtensions(with custom, e.g. ["pdf"]) andmaxFiles(1–100, null for no limit) (File List). Every setting is merged into the field's live settings; a setting for another type is refused, naming the types it applies to, and an unknown name is refused listing the valid ones.Choices of a Status/Select/Multi-Select field: option edits are a MERGE, so reuse a live option's
idto rename or recolour it in place, omit the id to add a new choice, and list ids inremoveOptionIdsto delete choices. Leaving an option out never deletes it. Never invent an option id — rows reference options by id and a wrong id is rejected.archived: truehides a Select/Multi-Select choice from pickers while rows keep it (Status choices cannot be archived).isDefault: truemakes a choice the default (a Multi-Select adds it to its defaults),falsetakes it out.orderlists the choice ids in their new order, every live id exactly once. On a Status field each choice sits in a stage bucket;sheet.schemareports it asstage(Todo / InProgress / Complete). Passstageon an item to put a new choice in that stage or move a live one (keep its id); a new choice defaults to Todo, and a Statusordermay also name just one stage's choices.stageis rejected on Select / Multi-Select and on an older Status field whose choices are not in stages.Not here: a relation's two-way setting (turning it off deletes the reverse field for good), a relation's target sheet (fixed once created), Pipeline stages (their ids are stored in the rows) and the Duration format. Point the user to the field's settings in the panel.
A dataType change follows a fixed compatibility list: a type that is not offered is refused with DATA_TYPE_CHANGE_NOT_ALLOWED, listing the allowed types, and nothing is changed. A change that would empty or shorten values is refused with DATA_TYPE_CHANGE_BLOCKED, carrying the counts, before → after samples and the views and workflows that use the field, and nothing is changed; show that to the user and call again with
confirmLoss: trueonly once they accept the loss. In a chat the user confirms the loss on a card instead: the call waits for it and applies the change once they accept.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date only: how the date and the time are written. | |
| icon | No | A Bootstrap icon name, e.g. `bi-star`. | |
| name | No | ||
| order | No | Choice ids in their new order, each live id exactly once. On Status, either every choice or every choice of one stage; a choice keeps its stage. | |
| number | No | Number only: currency or number format (e.g. Euro), decimal places, and how it shows (NUMBER, BAR…). | |
| default | No | The value new rows start with, as a human value: a choice title, a member, team or job name (a list for list fields), `creator` for whoever adds the row, or `today` for a Date's creation day. null clears it. | |
| options | No | ||
| sheetId | Yes | ||
| dataType | No | ||
| isUnique | No | Title, Short Text, URL, Phone Number and Email only: refuse duplicate values. | |
| language | No | Code only. | |
| relation | No | Relation only: how linked rows are shown and picked. | |
| attributeId | Yes | ||
| confirmLoss | No | Apply a dataType change even though it empties or shortens values. Only after reading the preview. | |
| description | No | ||
| selectStyle | No | Select / Multi-Select only. | |
| checkboxStyle | No | Checkbox only. | |
| removeOptionIds | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | The change was applied | |
| name | Yes | Its name after the change | |
| changed | Yes | The inputs that were applied, e.g. name, number, order, default | |
| attributeId | Yes | The field that changed |