Building templates
Common blocks
- Loop
- Loop with explicit schema
- Simple condition
- Temporary scope
- Value formatting
Conditional blocks
Tags reference
Aggregation tags
sum_by — Sums numeric values from a field across all items in a collection.All aggregation tags use decimal precision to avoid floating-point rounding errors. Missing or non-numeric fields are skipped. Returns
0 if no items match.Date and time tag
date_time — Outputs the current date and time formatted according to the provided format string. Time is generated in UTC.
Examples:
Arithmetic tag
calc — Evaluates mathematical expressions with support for variables from the template context.
Examples:
Variables that cannot be resolved default to
0. Division by zero produces an error.Grouped selection tag
last_item_by_group — Groups items by a field and selects the most recent item per group, ordered by a date field (descending). Optionally filters items first. Useful for regulatory reports that require the latest record per account grouped by category.group_by accepts a comma-separated list of fields for composite grouping. Maximum collection size: 100,000 items. Results are sorted by the group_by value for deterministic output.Counter tags
counter — Increments a named counter by 1. Produces no output. Counters are scoped per render.Filters reference
percent_of
Calculates the percentage of a value relative to a total. Returns a formatted string with 2 decimal places.category.amount = "6.00" and total.expenses = "20.00":
strip_zeros
Removes trailing zeros from a numeric value without rounding.slice
Extracts a substring using start and end indices (0-based).replace
Replaces all occurrences of a search string with a replacement string. Format:"search:replacement".
where
Filters an array of objects by field equality. Supports nested fields via dot notation.sum (filter)
Sums numeric values from a field across all items in an array. Uses decimal precision.count (filter)
Counts elements in an array where a field matches a value. Supports nested fields.contains
Checks if one value is partially included in another. Useful when data includes dynamic prefixes or suffixes.- Source:
0#@external/BRL - Target:
@external/BRL
true because @external/BRL exists within the source value.
Operators and filters summary
Advanced filtering
When generating a report, you can pass filters in the request body to narrow the data. Filters follow a structure of datasource > table > field: Single schema (default):

