Documentation
  • Welcome to Documentero Docs
  • General
    • Usage Limits and Quotas
    • Manage Account & Plans
    • Documentero Roadmap / Changelog
    • Privacy Policy
    • Frequently Asked Questions
  • templates
    • Templates Introduction & Tutorial
    • Template Upload/Re-upload
    • Organize Templates into Folders
    • Fields
    • Fields - Images
    • Fields - QRCodes
    • Fields - Links
    • Fields - HTML Support
    • Fields - Markdown Support
    • Fields - Mermaid Support
    • Fields - Formatters
    • Sections
    • Sections - Types & Options
    • Smart Fields
    • Smart Sections
    • Template Variables
  • Charts & Diagrams
  • Forms
    • Create Documents using Form
    • How to customize document form
    • Fields/Sections - General Settings
    • Field- Types & Options
      • Field - Multi Checkbox
      • Field - Checkbox
      • Field - Radio Button
      • Field - Datepicker
      • Field - Radio Select
      • Field - Select
      • Field - Multiline
      • Field - Number
      • Field - TextField
    • Conditional Fields & Sections
    • Shared Forms
      • Sharing Forms
      • Shared Form Configuration
      • Consent Form (GDPR)
      • Embeed & customize shared form on your website
  • Spreadsheet
    • Create Documents using Spreadsheet
  • API
    • Create Documents using API & JSON
    • Integrate with Documentero Cloud API
  • ChatGPT
    • Create Documents using ChatGPT
  • Integrations
    • Zapier
    • Make.com
    • Integrately
    • Pabbly Connect
    • Albato
    • Bubble.io Plugin
    • Webflow
    • Flutterflow
Powered by GitBook
On this page
  • Template Variable Assignments
  • Hidden Variables
  • Conditional Variables
  1. templates

Template Variables

PreviousSmart SectionsNextCharts & Diagrams

Last updated 3 months ago

Template Variable Assignments

Sometimes you want to calculate some value based on data input and reuse it across the document. You can do that using assignments within smart fields then you can use assign value within Smart Fields or Smart Sections Multiple Times

Cost of labor: {labor} USD
Cost of parts: {parts} USD

Total Cost: {$ total = labor+parts } USD

Total Cost + Tax: {$ total * 1.22 } USD (Including 22% Tax)

{#$ total > 1000 }
Warning! Your total net cost exceeds 1000 USD
{/}

Hidden Variables

You can combine variables with a . To create hidden calculated fields that you can use across your template. (E.g. You can define them at the top of the page based on values passed for document generation and use it in your template.

Cost of labor: {labor} USD
Cost of parts: {parts} USD
{$ total = (labor+parts) * 1.22 | hide}

Total Cost + Tax: {$ total} USD (Including 22% Tax)
Payment of {$ total} USD is due by 10-10-2026

Conditional Variables

You can combine variables with Smart Fields to use conditions to define multiple reusable values based on passed data.

Field value: {sampleField} (Assuming it could be value 'opt1' or 'opt2')

{$ variableName = sampleField == 'opt1' ? 'Text if option 1' : 'Text if not'}
{$ anotherVariableName = sampleField == 'opt1' ? 'Different text if option 1' : 'Different text if not'}

hide formatter