🔧 Variables & Helpers
Learn to use dynamic variables and Handlebars helpers to create powerful and flexible documents.
📦 Available Variables
👤 Customer Data
📍 Address
📅 System Data
🎯 Custom Variables
Create specific variables for your template:
Example:
🛠️ Handlebars Helpers
Helpers are functions that transform data. Use the syntax: {{helper value}}
🔤 Text Transformation
Uppercase
Result: JOHN SMITH
Lowercase
Result: john smith
Capitalize (first letter)
Result: John smith
Title Case (all words)
Result: John Smith
🔢 Numbers in Words (General)
Portuguese
Example: 250 → "duzentos e cinquenta"
English
Example: 250 → "two hundred and fifty"
Spanish
Example: 250 → "doscientos cincuenta"
🔢 Mathematical Operations
Apply mathematical operations to numeric variables. Accepts variables or literal numbers in any argument.
Examples:
💰 Currencies (Number + Currency Name)
💡 Tip
Currency helpers convert the number and add the currency name in words.
Brazilian Real (BRL)
Example: 1350.50 → "one thousand three hundred fifty reais and fifty centavos"
US Dollar (USD)
Example: 1350.50 → "one thousand three hundred fifty dollars and fifty cents"
Euro (EUR)
Example: 1350.50 → "one thousand three hundred fifty euros and fifty cents"
Argentine Peso (ARS)
Example: 1350.50 → "mil trescientos cincuenta pesos argentinos"
Paraguayan Guarani (PYG)
Example: 1350 → "mil trescientos cincuenta guaraníes"
⚠️ Warning
Monetary helpers include both the number AND the currency name. Don't add "reais", "dollars", etc. manually, as it will be duplicated.
💵 Currency Format (Symbol)
Formats numeric value with currency symbol. Use the country helper:
formatCurrency (no suffix) returns only the formatted number (1,350.50), without symbol.
📅 Dates
Full format (PT, EN, ES)
Short format
Day, month and year (separate, accepts GMT)
Date and time (accepts GMT, use "now" for current)
Time only (accepts GMT)
Using with custom fields
💡 Current date and time
Use "today" for current date and "now" for current date/time:
🔗 Combining Helpers
You can combine multiple helpers using parentheses:
Uppercase + In Words
Result: "ONE THOUSAND THREE HUNDRED FIFTY DOLLARS AND FIFTY CENTS"
Date in Uppercase
Result: "FEBRUARY 24, 2026"
Title Case + Currency
Result: "One Thousand Three Hundred Fifty Dollars And Fifty Cents"
Math Operation + Formatting
Result: total value ÷ 4 formatted in $ (e.g. $250.00)
💡 Practical Examples
Service Agreement
<h1>SERVICE AGREEMENT</h1>
<p><strong>CLIENT:</strong> {{uppercase customer.name}}</p>
<p><strong>SSN:</strong> {{customer.document}}</p>
<p><strong>Address:</strong> {{customer.address.street}}, {{customer.address.number}} - {{customer.address.city}}/{{customer.address.state}}</p>
<h2>CONTRACT VALUE</h2>
<p>The total value of this contract is <strong>{{formatCurrencyUSD custom.value}}</strong> ({{formatInWordsUSD custom.value}}).</p>
<p>Signed on {{formatDateEN "today"}}.</p>Multilingual Registration Form
<h2>Customer Information</h2>
<p><strong>Name:</strong> {{titleCase customer.name}}</p>
<p><strong>Email:</strong> {{lowercase customer.email}}</p>
<p><strong>Registration Date:</strong> {{formatDateEN date.current_date}}</p>Financial Report
<h2>Financial Report</h2>
<table>
<tr>
<td>Principal Amount:</td>
<td>{{formatInWordsUSD custom.principal_amount}}</td>
</tr>
<tr>
<td>Installment Value (÷ {{custom.num_installments}}):</td>
<td>{{formatCurrencyUSD (divide custom.principal_amount custom.num_installments)}}</td>
</tr>
<tr>
<td>Issue Date:</td>
<td>{{formatDateShortEN "today"}}</td>
</tr>
</table>🎯 Advanced Tips
1. Consistent Formatting
Always use the same helper for similar data types:
2. Visual Context
Add context around variables:
3. Default Values
For optional variables, consider using conditionals (see Conditionals):
🎬 Next Step
Learn to use Conditionals to create even smarter and more dynamic documents!