Skip to content

Creating variables to use with objects

2 min read · Updated 11 Nov 2026

A workbook variable holds one value for the workbook. Changing the variable changes every place that reads it, so you do not have to edit each object. You can:

These are variables of a workbook. A Data App has no workbook variables: it sends parameter values with its queries instead, as Querying the engine describes.

Type Value
Boolean True or False. Use it in conditions, or to show and hide objects.
Number A number, or a date when you choose Date instead of Number. Use it in calculations and comparisons.
String Text. Its sub-type is Plain text by default, or SQL query.

A String variable with the SQL query sub-type holds a SQL statement. The Execute SQL blocks in the Writeback & SQL category of actions list only these variables, and run the statement stored in the one you choose.

  1. In the toolbar on the left of the Workbook Editor, select Variables.

  2. Select Add Variable. A new variable is added to the bottom of the list with a generated name.

  3. Enter a name in the Name new variable field. Each name must be unique in the workbook.

  4. Choose the type, then set the value:

    • Boolean: select True or False.
    • Number: choose Number and enter a number in Value, or choose Date and pick a date.
    • String: enter the text in Value, or select More to open Define your variable. There, choose Plain text or SQL query, enter the value in the larger field and select Done.
  5. Optionally, select Exclude from bookmarks, so that bookmarks neither save nor restore this variable’s value.

The menu on each variable has Copy Variable and Delete. Above the list, Copy all variables copies the workbook’s variables to the clipboard, and Paste variables adds variables from the clipboard.

Variables options highlighting the More button displayed with String variables.

The larger String variable field, where you choose the sub-type and enter the value.

A variable can hold a benchmark that a chart compares its data against. In the recording above, the variable holds a fuel-efficiency target, and the chart changes as soon as the target is updated. For the difference between workbook variables and the parameters they feed, see Measure parameters.