> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qobra.co/llms.txt
> Use this file to discover all available pages before exploring further.

# update_record

> Change some cells of one data table record, archive it or restore it.

Change some cells of one record, archive it or restore it.

Only the fields listed change. Call get\_data\_table first for the ids, the type
each value takes and `editable` (false for lookups and links, which cannot be
written), and list\_data\_table\_records for the current values.

On a record synced from an integration the edit is kept as an overwrite and the
synced value is preserved beside it, as in the web app. An import run with the
"override" policy replaces the edit with the synced value.

Statements are not recalculated by this call, just as when a record is edited in
the web app. They pick the change up at the next automatic recalculation, or
when someone refreshes them.

Requires write permission on data tables. Not available on demonstration
companies. Available only where the Qobra write tools beta is enabled. Every
write is recorded in the audit trail as the `Qobra MCP` agent.

## Parameters

<Accordion title="Body" defaultOpen>
  <ParamField body="record_id" type="string" required>
    Id of the record to change — the id list\_data\_table\_records returns.
  </ParamField>

  <ParamField body="values" type="object[]">
    The cells to change, one per field. A field left out keeps its value;
    `value: null` empties a cell. Omit to change only `active`.

    <Expandable title="object properties">
      <ParamField body="field_id" type="string" required>
        Id of the column — a field id get\_data\_table returns. Only a field
        whose `editable` is true can be written.
      </ParamField>

      <ParamField body="value" type="string | number | boolean | string[]">
        The cell's new value, in the shape the read tools serve it: a number
        for amount / float / percentage (a percentage is the ratio, 0.8 for
        80%), true/false for bool, an ISO date for date, text for string, one
        option label for picklist, a list of option labels for
        multipicklist, and a user id for user. null empties the cell.
      </ParamField>

      <ParamField body="currency" type="string">
        Currency code of an amount (EUR, USD…). Omit it to keep the cell's
        currency; ignored on every other type.
      </ParamField>
    </Expandable>
  </ParamField>

  <ParamField body="active" type="boolean">
    false archives the record, true restores it. Omit to leave it as it is.
  </ParamField>

  <ParamField body="reason" type="string">
    Why the record is changed — one of the table's `adjustment_reasons` from
    get\_data\_table. Required only when that list is not null; omit it
    otherwise.
  </ParamField>

  <ParamField body="comment" type="string">
    Optional note kept in the record's history.
  </ParamField>
</Accordion>

The call is refused, with a message naming the problem, when no record has the
`record_id`, when neither `values` nor `active` is passed, when a `field_id` is
unknown or listed twice, when a field is a lookup or a link to another table,
when a value does not match its field's type or picklist options, or when the
table requires a `reason` and none from its `adjustment_reasons` was passed.

## Example

```json theme={null}
{
  "record_id": "665f1c2e8a4b3d0012a7ea10",
  "values": [
    { "field_id": "665f1c2e8a4b3d0012a7e9f3", "value": 15000, "currency": "EUR" },
    { "field_id": "665f1c2e8a4b3d0012a7e9f4", "value": null }
  ],
  "reason": "Amount correction",
  "comment": "Amount renegotiated after signature."
}
```

To archive a record without changing its values, pass only `active`:

```json theme={null}
{
  "record_id": "665f1c2e8a4b3d0012a7ea10",
  "active": false
}
```

## Response

<Accordion title="Body" defaultOpen>
  <ResponseField name="data_table" type="object">
    The table of the record, whose `fields` header names the record's values
    in order — the same row list\_data\_tables returns. See
    [`list_data_tables`](/mcp_documentation/tools/list_data_tables) for the
    full field breakdown.
  </ResponseField>

  <ResponseField name="record" type="object">
    The record as it now exists — the same row list\_data\_table\_records
    returns. Its `values` are read in the order of `data_table.fields`. See
    [`list_data_table_records`](/mcp_documentation/tools/list_data_table_records)
    for the full field breakdown.
  </ResponseField>

  <ResponseField name="changes" type="object[]">
    What this call changed, the record's archived state included (as 'Active
    record'). Empty when nothing changed — the call then wrote and recorded
    nothing.

    <Expandable title="object properties">
      <ResponseField name="field" type="string">
        Name of the field that changed.
      </ResponseField>

      <ResponseField name="before" type="string | null">
        The value before the call, as the record's history shows it.
      </ResponseField>

      <ResponseField name="after" type="string | null">
        The value after the call, as the record's history shows it.
      </ResponseField>
    </Expandable>
  </ResponseField>
</Accordion>
