Every block that accepts text — SQL queries, email subject and body, Slack messages, file names, webhook payloads — supports Jinja templating. PushMetrics injects a set of builtin variables and filters you can use to make those blocks dynamic.

This page is the canonical reference. To insert these values without typing them, click the {} Insert variable button next to the SQL editor, the merge filename input, or the export filename. In Email / Docx / Slack, the same catalog is reachable from the References toolbar button. The picker pastes the full {{ … }} expression at the cursor.

Where the timezone comes from

Date and time variables render in the workspace timezone, set under Account Settings → Workspace Timezone. An admin can change this at any time.

Date & Time

These render in your workspace's timezone (configured by an admin under Workspace settings; defaults to UTC).

Variable Returns Example
{{ utils.datetime }} Date and time 2026-05-08 14:30
{{ utils.date }} Today's date 2026-05-08
{{ utils.time }} Time of day 14:30
{{ utils.timestamp }} ISO 8601 with timezone 2026-05-08T14:30:00+02:00
{{ utils.today }} Same as utils.date 2026-05-08
{{ utils.yesterday }} One day before today 2026-05-07
{{ utils.tomorrow }} One day after today 2026-05-09
{{ utils.last_week }} 7 days ago 2026-05-01
{{ utils.last_month }} One calendar month ago 2026-04-08
{{ utils.start_of_week }} Monday of the current week 2026-05-04
{{ utils.start_of_month }} First day of the current month 2026-05-01
{{ utils.end_of_month }} Last day of the current month 2026-05-31
{{ utils.hour }} Hour of day (integer, 0–23) 14
{{ utils.minute }} Minute of hour (integer, 0–59) 30

Custom formats with utils.now()

For any format utils.datetime doesn't cover, call utils.now() with a strftime pattern:

{{ utils.now('%d %B %Y') }}            → 08 May 2026
{{ utils.now('%A, %b %d') }}           → Friday, May 08
{{ utils.now('%Y-%m-%d %H:%M:%S') }}   → 2026-05-08 14:30:45

You can also override the timezone for a single call:

{{ utils.now('%H:%M', tz='America/New_York') }}   → 08:30

User

Identifies the user who triggered the run (manual run, scheduled run owner, or workflow trigger).

Variable Returns
{{ utils.user_email }} Email address
{{ utils.user_first_name }} First name
{{ utils.user_name }} Last name
{{ utils.user_id }} Unique user ID

Workspace & Report

Variable Returns
{{ utils.workspace_name }} Workspace display name
{{ utils.workspace_id }} Workspace UID (e.g. WS_abc123)
{{ utils.organization_name }} Organization display name
{{ utils.report_name }} Current report's name
{{ utils.report_id }} Report UID (e.g. R_abc123)
{{ utils.user_id }} User UID (e.g. U_abc123)
{{ utils.report_url }} Direct link back to the report editor in PushMetrics

All workspace/report variables fall back to an empty string when unavailable (e.g. ad-hoc agent runs without a report), so referencing them in a template never errors — it just renders blank.

Filters

Pipe (|) a value into a filter to transform it.

Filter Description Example
date_format(pattern) Reformat any date string. Accepts strftime patterns. {{ utils.date | date_format('Today is %d %b %Y') }}
date_add(days) Add N days to a YYYY-MM-DD date string. {{ utils.date | date_add(7) }}
date_subtract(days) Subtract N days. {{ utils.date | date_subtract(1) }}
escape_double_quotes Escape " for safe embedding in JSON or shell strings. {{ row.label | escape_double_quotes }}
escape_backslash Escape \ characters. {{ raw_path | escape_backslash }}
is_true / is_false Coerce common truthy/falsy strings to booleans. {% if flag | is_true %}…{% endif %}
first_value Return the first value of a dict (e.g. the first column of a SQL row). {{ row | first_value }}

Legacy aliases

These older names still work and will continue to be supported. New reports should prefer the names in the table above.

Legacy Preferred Notes
{{ utils.ds }} {{ utils.date }} utils.ds always reports the UTC date; utils.date honours the workspace timezone.
{{ utils.ds_yesterday }} {{ utils.yesterday }} Same UTC vs workspace-tz distinction as ds.
{{ utils.ts }} {{ utils.timestamp }} ts is a millisecond Unix integer; timestamp is an ISO string.
{{ ds }}, {{ ds_yesterday }}, {{ now }}, {{ ts }} (use utils.* form) Top-level aliases without the utils. prefix; equivalent to their utils.X counterparts.

Worked example

A weekly summary email that subjects with the report name and the week-ending date, salutes the recipient, and links back to the report:

Subject: {{ utils.report_name }} — week ending {{ utils.date }}

Hi {{ utils.user_first_name }},

Here's this week's update for {{ utils.workspace_name }}
({{ utils.organization_name }}).
View the full report: {{ utils.report_url }}

— sent {{ utils.now('%d %b %Y at %H:%M %Z') }}