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 (&, <, numeric references and are resolved first, and 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
documentIdRequiredblockIdOptionalblockLinkIdOptionallockTokenRequiredrevisionTokenOptionaltextOperationsOptionalexpectedBlockRevisionOptionaloperationsOptional