Documentation Index
Fetch the complete documentation index at: https://docs.spitshake.io/llms.txt
Use this file to discover all available pages before exploring further.
DOCX Template Variables
DocuTrust supports variable substitution in DOCX templates. Use[[variable_name]] syntax to insert dynamic content, and [[if:variable]]...[[end]] for conditional blocks that appear only when a variable has a value.
Variable syntax
Basic variables
Wrap variable names in double square brackets:[[variable_name]] placeholder is replaced with the corresponding field value from the signer’s submission.
Example DOCX content:
Variable naming rules
| Rule | Valid | Invalid |
|---|---|---|
| Use lowercase letters, numbers, and underscores | signer_name, rate_2026 | Signer Name, rate-2026 |
| Must start with a letter | full_name | 2nd_signer |
| No spaces | company_name | company name |
| No special characters (except underscore) | address_line_1 | address.line.1 |
Conditional blocks
Use[[if:variable]]...[[end]] to create sections that only appear when the referenced variable has a non-empty value.
addendum_text is empty or not provided, the entire block (from [[if:addendum_text]] to [[end]]) is removed from the final document.
Nested conditionals
Conditional blocks can be nested:Built-in variables
DocuTrust provides several built-in variables that are automatically available in every DOCX template. You do not need to define fields for these — they are populated from the submission context.| Variable | Description | Example value |
|---|---|---|
signer_name | The current signer’s full name. | Jane Smith |
signer_email | The current signer’s email address. | jane@example.com |
signing_date | The current date when the signer opens the form (formatted per account locale). | April 9, 2026 |
submission_id | The unique submission identifier. | 187 |
template_name | The name of the template. | Service Agreement |
account_name | Your account/company name from settings. | Acme Inc |
Mapping fields to variables
DOCX variables are mapped to template fields by the field’skey property. When you create a template from a DOCX file, DocuTrust auto-detects [[variable_name]] placeholders and creates corresponding fields in the schema.
Automatic field creation
When uploading a DOCX with variables:[[variable]] placeholders and creates text fields for each one. The resulting template schema:
Built-in variables (
signer_name, signer_email, signing_date, submission_id, template_name) are not created as fields since they are populated automatically from the submission context.Pre-filling variables via submission
When creating a submission, pre-fill DOCX variables using thevalues object keyed by the field’s key property:
Formatting in DOCX
DOCX variables preserve the formatting of the surrounding text. If[[company_name]] is bold in the DOCX file, the substituted value will also be bold.
Formatting rules:
| Scenario | Result |
|---|---|
| Variable placeholder is bold | Substituted value is bold |
| Variable placeholder is italic | Substituted value is italic |
| Variable placeholder has a specific font size | Substituted value uses that font size |
| Variable spans multiple font styles | The first style is applied to the entire value |