Document apiReferenceTables

tables.sort

Sort table rows by column values, preserving the leading repeating-header prefix unless skipHeaderRows specifies an exact override. Repetition flags and styling remain attached to their rows. Collaborative sessions reject structural table rewrites without mutation.

mutates documentdry runnon-idempotent
doc.tables.sort(…)

Expected result

Returns a TableMutationResult receipt confirming rows were reordered.

Inputs

targetTableAddressconditionally required
Fields
kind"block"required
nodeType"table"required
nodeIdstringrequired
nodeIdstringconditionally required
keysobject[]required

At least one sort key is required.

1 additional input field
skipHeaderRowsinteger

Exclude exactly this many leading rows, overriding automatic detection even when smaller than the repeating-header prefix. Omit to preserve the contiguous prefix of enabled repeating-header rows. Zero sorts all rows; the row count is a no-op; a larger count returns a nonmutating INVALID_TARGET failure receipt. Malformed counts throw INVALID_ARGUMENT before the adapter. Repetition flags and styling remain unchanged.

Result

Output fields
true
successtruerequired
appliedChangeMode"direct" | "tracked"
tableTableAddress
Fields
kind"block"required
nodeType"table"required
nodeIdstringrequired
trackedChangeRefsEntityAddress[]
false
successfalserequired
failureobjectrequired
Fields
code"NO_OP" | "INVALID_TARGET" | "TARGET_NOT_FOUND" | "CAPABILITY_UNAVAILABLE"required
messagestringrequired
detailsunknown

Failures

Pre-apply throws

  • TARGET_NOT_FOUND
  • INVALID_TARGET
  • CAPABILITY_UNAVAILABLE
1 more codes
  • INVALID_ARGUMENT

Non-applied receipt codes

  • INVALID_TARGET

Raw schemas

Open the generated JSON artifact for the exact input, output, success, and failure schemas represented by this contract version.

View raw JSON schemas