ONLYOFFICE Docs icon

ONLYOFFICE Docs

Consume ONLYOFFICE Document Server API (Conversion, Document Builder)

Document Builder → Fill Template

AI-generated

Summary

Fills matching {{key}} placeholders in a document with values from a JSON object, then saves the result in the selected format. The input URL must be reachable by the ONLYOFFICE Document Server; use expressions such as {{ $json.outputUrl }} to pass a URL from an earlier step.

Inputs

  • File URL (required) — URL of the template document, accessible to the ONLYOFFICE Document Server.
  • Template Data (JSON Object) (required) — Key-value pairs used to replace matching placeholders throughout paragraphs and table cells. For example, { "name": "Alice" } replaces {{name}}; values are converted to strings. You can pass {{ $json }} to use the current item's fields.
  • Output Mode — Choose File Data (default) to download the generated document into the configured binary field, or URL Only to return its Document Server URL without downloading.
  • Output Format — Generated document format: DOCX (default), PDF, or PPTX.
  • Output File Name — Output filename without extension; defaults to output. Used when returning file data.
  • Put Output File in Field — Name of the binary output field; defaults to data. Used when returning file data.

Output shape

One item per input item, with JSON fields fileName, operation, and outputUrl; in File Data mode it also contains the generated file as binary data in the configured field.

In URL Only mode, the output contains the JSON fields without binary data. The filename includes the selected format extension. Placeholders are replaced in paragraph text and table-cell paragraphs; replacement rebuilds changed paragraph text as a single run.

Links

Discussion