DOCX Template Filler
AI-generatedSummary
Fills placeholders in a DOCX template using tags from an input JSON item.
Inputs
- binaryProperty (required) — Name of the binary property containing the source DOCX document with {{TAG}} placeholders. Typically produced by the TemplateMapper node.
- dataSource (required) — Source of data for injection. 'fullJson' uses the entire current item JSON, converting keys to tags (e.g., company.name → COMPANY_NAME). 'specificField' uses a specific JSON field containing a mapping object.
- dataField — Name of the JSON field containing the mapping object when dataSource is 'specificField'. This field must contain keys matching the document tags.
- checkboxStyle — Display style for boolean values (checkboxes): 'unicode' (☑/☐), 'text' (X/ ), or 'boolean' (true/false).
- outputFilename — Filename for the generated DOCX. If empty, uses the source filename with a '_FILLED' suffix.
- keepEmptyTags — If true, keeps empty tags (e.g., {{TAG}}) without replacement; otherwise, they are removed.
- includeReport — If true, includes a mapping report in the output JSON listing replaced and unreplaced tags.
Output shape
A single item with a modified binary property containing the filled DOCX and, if enabled, a mapping report in the JSON data.
The operation processes loops (e.g., {#ARRAY}...{/ARRAY}) using the 'fullJson' source. Tags are case-insensitive. The node validates the document XML structure before filling.
Examples
Example 1: Populate a template using the full current item JSON.
Set binaryProperty to 'data', dataSource to 'fullJson'.
Example 2: Use a specific JSON object for mapping.
Set binaryProperty to 'data', dataSource to 'specificField', and dataField to 'mappingData'.
Example 3: Generate a report and handle empty tags.
Enable includeReport and keepEmptyTags.