Categories
Document Templates
Create dynamic document models with auto-filled fields, conditional logic, and repetition.
published
Document Templates
Document templates allow you to generate files automatically based on custom models — ideal for creating contracts, declarations, terms, and more.
What is it for?
- Generate dynamic documents with automatically filled fields
- Use conditional logic and repetition in the content
- Integrate with notifications and the document editor field
Fields for Creating the Template
- Name *
- Output * (name of the generated file)
- Description
Document Editor
After creating the template, you will be directed to the editor, where you can build the document using OnlyOffice (the text editor integrated with Enspace).
Using Variables
You can use dynamic variables to insert data from the type’s fields.
Example:
{{data.area_text_formatted}}
This value will automatically be replaced by the content of the "text area" field from the item.
Available Code Blocks
Conditional Block (Text)
{{IF variable === 'value'}} content {{END-IF}}
Example:
{{IF data.status === 'Approved'}} Document approved. {{END-IF}}
Conditional Block (Number)
{{IF variable === 123}} content {{END-IF}}
Repetition Block
{{FOR item IN variable}}
content
{{= $item.subfield}}
{{END-FOR item}}
Example:
{{FOR guarantor IN data.other_party}}
name = {{= guarantor.name }}
{{END-FOR guarantor}}
Where can this template be used?
- Automatic Notifications
- Field "Document Editor" (inside forms or flows)