Learn how to create and configure DOCX templates with Mustache syntax and AI-powered field detection for automated document generation
Upload Your DOCX Document
Name and Describe Your Template
Edit Document with Mustache Syntax
{{ }}
as delimiters. This syntax allows you to create dynamic content that adapts based on data inputs while maintaining document structure and formatting. Use the following syntax elements to create dynamic content:Syntax | Purpose | Example | Detailed Explanation |
---|---|---|---|
{{ variable_name }} | Insert a variable value | {{ client_name }} , {{ contract_date }} | Simple variable interpolation - replaces the placeholder with the actual value from your data. The variable name should be descriptive and match the data field exactly. Variables are case-sensitive and can include underscores but should avoid spaces. |
{{ ? condition }} content {{ / condition }} | Conditional content display | {{ ? is_corporate }} This is a corporate agreement {{ / is_corporate }} | Conditional sections that only display content when the condition evaluates to true. The condition can be any boolean variable or expression. Content between the opening and closing tags will only appear in the final document if the condition is met. Perfect for showing different clauses based on client type, agreement terms, or other binary decisions. |
{{ # items }} {{ item_value }} {{ / items }} | Loop through list items | {{ # witnesses }} {{ name }}, {{ title }} {{ / witnesses }} | Iteration blocks that repeat content for each item in a list or array. The opening tag {{ # items }} starts the loop, and the closing tag {{ / items }} ends it. Everything between these tags will be repeated for each item in the collection. Inside the loop, you can access properties of each item using dot notation or simple variable names. |
{{! comment text }} | Add comments (not rendered) | {{! This section handles payment terms }} | Comment blocks that are ignored during template processing and won’t appear in the final document. Use these for documentation, notes to other template editors, or temporary removal of content. Comments are essential for maintaining complex templates and explaining business logic to future editors. |
{{ client.address.street }}
{{ ^ condition }}
to show content when a condition is false{{ > partial_name }}
Sync Template Fields
Review and Configure Field Instructions
Save and Publish
Descriptive Variable Names
{{ client_full_legal_name }}
rather than generic names like {{ name1 }}
. This helps with AI understanding and template maintenance. Consider using naming conventions like entity_type
, agreement_date
, billing_address_line1
to create consistency across your templates.Logical Content Structure
Comprehensive Field Instructions
Regular Testing