Basic Variable Syntax
Variables in TemplateMark are enclosed in double curly braces and reference properties from your data model.Simple Variables
Access top-level properties directly by name:Nested Object Properties
Access nested properties using dot notation:Date Formatting
Format date and time values using theas keyword with format strings:
Common Date Formats
- Full Date
- Short Date
- ISO Format
01 February 2025Number Formatting
Format numeric values using theas keyword with numeral.js format patterns:
Common Number Formats
- Decimal
- Integer
- Percentage
1,250.00Special Variables
The now Variable
TemplateMark provides an implicit now variable representing the current date and time:
The
now variable is only accessible within formula expressions (between {{% %}}).The this Variable
Within list iterations and clause blocks, use this to reference the current item:
Best Practices
Use descriptive variable names
Use descriptive variable names
Choose variable names that clearly indicate their purpose:
Always format dates
Always format dates
Raw date values are not human-readable. Always use the
as formatter:Format currency consistently
Format currency consistently
Use consistent number formatting for currency values:
Related Topics
Conditionals
Learn about conditional rendering based on variable values
Formulas
Perform calculations and transformations on variables
Lists
Iterate over array variables