Template variables


Standard variable mode ( Infinity Query )#

Like panels, you can have your own CSV/JSON in your variable. Variable queries are expected to return one or more columns. This will give you the ability to get your variables set from CSV/JSON/XML or any other external sources.

image

If you want to have variables with different text than its value, then rename the columns to __text and __value respectively.

It is always recommended to rename your columns to __text/__value when having more than 1 column in your variable query. Any other columns except __text/__value will be ignored when there are more than 1 column. This is useful in scenarios where backend queries require more columns to perform operations such as filtering but want to select only one column for variable.

Collection - (Legacy variable)#

List of key value pair wrapped with Collection(). Text/key followed by values separated by commas.

For example, the query Collection(Prod,pd,Non Prod,np,Development,dev,SIT,sit) produce 4 variables

Collection(Prod,pd,Non Prod,np,Development,dev,SIT,sit)
Display ValueValue
Prodpd
Non Prodnp
Developmentdev
SITsit

Under the hood following 4 keys have corresponding values

CollectionLookup - (Legacy variable)#

Return values based on another value similar to VLOOKUP in excel. For example, CollectionLookup(pd,prod-server,np,nonprod-server,dev,dev-server,$Nested) will return nonprod-server if value of $Nested equals np . Last value should be the key to lookup.

This will be useful when multiple variables need update based on single variable.

CollectionLookup(pd, prod - server, np, nonprod - server, dev, dev - server, $Nested);

image

image

image

Join - (Legacy variable)#

Joins multiple strings / variables and return as a new variable

Example : Join($Environment,-hello-,$ServerName) will produce a new string variable from three separate strings.

Random - (Legacy variable)#

Example : Random(A,B,C) will produce one of A/B/C. When creating a variable of this type, set it to refresh "on time range change", so it will produce random element when dashboard refreshes.

More details available in this github issue.

UnixTimeStamp (alpha) - (Legacy variable)#

Return relative timestamp in unix timestamp.

VariableOutput
UnixTimeStamp()Current browser timestamp in ms
UnixTimeStamp(s)Current browser timestamp in s