Create a variable

There are multiple variable types that provide different means of populating your list of variable values. For information about variable types, see .

Variable name restrictions

Variable names must begin with a letter or underscore ().

The following names cannot be used as dashboard variables because they are reserved keywords in Flux: and, import, not, , option, test, empty, , or, package, and builtin.

InfluxData recommends using the Data Explorer to create . The Table visualization type and View Raw Data option to provide human-readable query results.

  1. Click the Data Explorer icon in the sidebar.

    Data Explorer

  2. Use the Query Builder or Script Editor to build a query.

  3. Use the or enable the View Raw Data option to view human-readable query results.

  4. In the window that appears, select Variable.

  5. Enter a name for your variable in the Name field.

  6. Click Create.

For information about common Query variables, see Common variable queries.

  1. Click the Settings icon in the navigation bar.

    Settings

  2. Select the Variables tab.

  3. Enter a name for your variable.

  4. Click Create.

InfluxDB lets you import variables exported from InfluxDB in JSON format.

  1. Click the Settings icon in the navigation bar.

    Settings

  2. Select the Variables tab.

  3. Click the Create Variable drop-down menu and select Import Variable.

  4. In the window that appears:

  • Select Upload File to drag and drop or select a file.
  • Select Paste JSON to paste in JSON.