Variable types

Map variables use a list of key value pairs in CSV format to map keys to specific values. Keys populate the variable’s value list in the InfluxDB user interface (UI), but values are used when actually processing the query.

The most common use case for map variables is aliasing simple, human-readable keys to complex values.

Map variable example
Query variable example

For examples of dashboard variable queries, see .

Important things to note about variable queries

  • The variable will only use values from the _value column. If the data you’re looking for is in a column other than , use the or map() functions to change the name of that column to _value.
  • The variable will only use the first table in the output stream. Use the to group everything into a single table.
  • Do not use any predefined dashboard variables in variable queries.

CSV variables use a CSV-formatted list to populate variable values. A common use case is when the list of potential values is static and cannot be queried from InfluxDB.

CSV variable examples

For example, to use a custom dashboard variable named exampleVar in a query, reference the variable with :

To select variable values:

  • In the Script Editor: Click the Variables tab on the right of the Script Editor, click the name of the variable, and then select the variable value from the drop-down menu.