Grafanano signalmediumCluster of 4 signals
Card #3654 · Grafana

Unable to use template variables in metric script fields and queries

Merchants are struggling to inject template variables into script calculations and specific query fields. They find that variables are often passed as literal text rather than their assigned values, preventing dynamic calculations.

GrafanaUpdated 1d ago0.15
Pain score
0.15/ 1.00 · weighted product of four components
Reach0.63
distinct authors (log-normalized)
Recency1.00
freshness decay, half-life months
Engagement0.59
upvotes + comments, normalized
Monetization0.25
willingness-to-pay cues in evidence
§ Evidence — 3 verified quotes
The Query Inspector shows that the literal variable text (i.e. $TotalThroughput) is inserted in the query, rather than the value I assigned to the variable (i.e. 18174).
Forum·@turbo··source ↗
I can’t see how to use a Template variable in the Script Field and have it interpreted before submitting the query.
Forum·@turbo··source ↗
Template variables could not be initialized: a.metricFindQuery(...) is undefined
Forum·@michaelaeino··source ↗

Comments are a Pro feature — join the conversation, share what you've shipped, hear what others are building.

Upgrade to Pro