Changes data

quotecloud_replace_text

Edit the rich text of one text block. Supply exactly one argument family. textOperations + revisionToken is the normalized family and works on documents in either contentMode: replaceText finds and replaces literal text inside the block, setHtml replaces the block’s whole value. operations + expectedBlockRevision is the revisioned family, which upserts and deletes QC_documentTextSegments rows directly and needs each segment revision. Address the block by blockId or by blockLinkId (its API Link ID). Replacement is scoped to the addressed block; there is no document-wide search. replaceText semantics: the block’s HTML is split into markup and the text between it, and only the text is searched, so every tag, class and inline style survives untouched; matching is on the decoded text (&amp;, &lt;, numeric references and &nbsp; are resolved first, and &nbsp; matches a space); a phrase interrupted by inline markup does not match, because "Hello " and "world" in "Hello <strong>world</strong>" are separate runs; the replacement is HTML-escaped, so it cannot introduce markup; occurrence "first" counts across the whole block, not per run; and a replaceText that matches nothing is refused with text_find_not_found rather than reported as a successful no-op. A merge field is not text: the contents of a data item’s span are skipped exactly like markup, because that text is rendered from the data item the span names and a replacement written into it is discarded the next time the document is opened. A replaceText whose only match lies inside one is refused with text_find_inside_merge_field and points at quotecloud_update_data_item_values, which changes what the field resolves to everywhere at once; a find that also matches ordinary text is applied to that text as usual. setHtml replaces the block’s whole value and may therefore add or remove merge-field spans.

Inputs

documentIdRequired
Convex document ID or company-scoped numeric display ID. string
blockIdOptional
The block id reported by quotecloud_inspect_structure. Supply this or blockLinkId, not both. string
blockLinkIdOptional
The block’s API Link ID (BlockData.apiLinkId), the short handle set in the editor. Supply this or blockId, not both; a link id shared by several blocks is refused as ambiguous. string
lockTokenRequired
Stable opaque token for this agent edit session. Reuse it to heartbeat owned element locks. string
revisionTokenOptional
Document revisionToken from quotecloud_inspect_structure. Selects the normalized argument family, which works in either contentMode; the write is refused with a *_revision_conflict if the document moved since it was read. string
textOperationsOptional
Normalized text operations applied in order to the addressed block. Requires revisionToken. list of value
expectedBlockRevisionOptional
number
operationsOptional
Revisioned fine-grained segment operations. Requires expectedBlockRevision and blockId. list of value