Skip to main content

Dashboard template parameters

Authoring tools can mark parts of a query with ${name} so one saved query can be reused with different concrete values. Template holes are allowed only for linting and type-checking against a catalog: you must substitute real literals and table paths before translation or execution.

Syntax​

  • Expressions: use ${param} like a leaf (similar to a field reference), for example WHERE region = ${region} or WHERE timestamp > now() - ${lookback}.
  • Timestamp truncation units: use @${param} immediately after an expression when param is an interval primitive, for example timestamp @${timeslice}.
  • Table paths: each dot-separated segment can mix literal identifier text and parameters, for example logs.${env}_events or db.${which}. An optional space prefix uses a single colon before the path: other:${env}.events or ${space}:signals.events (see Spaces and dataset references).

Parameter names follow the same rules as unquoted simple identifiers.

Parameter kinds​

Declare parameters in template_parameters (or the editor equivalent):

KindPurposeExample value
primitiveSubstitutes as a typed literal in expressions (and in @${name} when the type is interval)"us", 42, true, interval "1h"
identifier_fragmentSubstitutes into table path segments; typed as string in expressions"events_prod"

Interval primitive​

Use primitive with "type": "interval". Values must be valid Hamelin interval literals (1h, 7d, 15min, and so on).

  • In expressions, ${timeslice} becomes that interval literal.
  • After @, ${timeslice} becomes timestamp truncation derived from the interval (for example 1h → @1h).

Example spec (JSON):

{
"timeslice": {
"kind": "primitive",
"type": "interval"
}
}

With timeslice set to "1h", timestamp @${timeslice} becomes timestamp@1h after substitution.