update

fun DocumentEditor.update(fieldId: String, cellUpdates: Map<Column, Any?>, rowId: String? = null, schemaId: String? = null)

Updates a table row with new cell values.

This function allows you to update specific cells in a table row. If no rowId is provided, a new row will be created automatically. The function supports both regular table fields and collection table fields.

Usage Examples:

// Update an existing row
editor.update(
fieldId = "employees_table",
rowId = "row_123",
cellUpdates = mapOf(
nameColumn to "John Doe",
ageColumn to 30.0
)
)

// Create a new row (no rowId provided)
editor.update(
fieldId = "employees_table",
cellUpdates = mapOf(
nameColumn to "Jane Smith",
ageColumn to 25.0
)
)

Parameters

fieldId

The unique identifier of the table field to update. This can be either a regular table field or a collection table field.

cellUpdates

A map where keys are Column objects and values are the new cell values. The values can be of any type supported by the column (String, Number, etc.).

rowId

Optional identifier of the specific row to update. If null, a new row will be created. If provided, the row must exist in the table.

schemaId

Optional schema identifier for collection fields. This is required when working with collection table fields to specify which schema to use. For regular table fields, this parameter is ignored.

Throws

if the fieldId doesn't correspond to a valid table field.

if a rowId is provided but the row doesn't exist in the table.