Skip to content

Variables in the classic Workbook Editor

4 min read · Updated 26 Nov 2026

This page covers variables in the classic Workbook Editor. A Data App has no workbook variables; it sends parameter values with its queries instead, as Querying the engine describes.

A workbook variable holds one value for the whole workbook. Every place that reads the variable picks up a new value when it changes, so you change the value once instead of editing each object. You can use a variable to:

  1. In the toolbar on the left of the editor, select Variables.
  2. Select Add Variable. The new variable appears at the bottom of the list, named New Variable 1 (or the next free number).
  3. Replace the name in the name field. Names must be unique in the workbook. A duplicate or empty name shows an error icon whose tooltip reads Please enter a unique name., and the name goes back to its previous value when you leave the field.
  4. Optional: select Exclude from bookmarks, so that bookmarks neither save nor restore this variable’s value.
  5. Choose the type from the list under Exclude from bookmarks, then set the value as described in Variable types.

A new variable takes the type of the last variable you edited, or String if you have not edited one. When the list is filtered to Boolean, Number, String or SQL, a new variable takes that type; the SQL filter gives a String with the SQL query sub-type. Its starting value is True for a Boolean, 0 for a Number and empty for a String.

Type Value
Boolean True or False. Use it in conditions, or to show and hide items.
Number Choose Number and enter a number in Value, or choose Date and pick a date.
String Text, entered in Value. Its sub-type is Plain text or SQL query.

To enter a longer String, or to change its sub-type, select More. In Define your variable, choose Plain text or SQL query, enter the value and select Done.

The Define your variable dialog with its sub-type list open, offering Plain text and SQL query, above a large value field and a Done button.

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.

The type list also offers Data Set, which this page does not cover. A Data Set variable is always excluded from bookmarks.

Above the list, Search matches variable names, and the type list filters by Boolean, Number, Date, String, SQL or Data Set (All items shows every variable). Sort variables by name orders the list by name.

Each variable’s menu has Copy Variable and Delete. If the variable is used elsewhere in the workbook, Delete first asks you to confirm in Variable is in use, which gives the number of places that use it; those parts of the workbook may stop working once you confirm.

To move variables to another workbook:

  1. In the source workbook, select Copy all variables. It copies the variables currently listed, so clear the search and filter first to copy them all.
  2. In the target workbook, clear the search and filter too, then select Paste variables. Your browser may ask for permission to read the clipboard.
  3. Review Import Variables from CSV. It lists New Variables, and Variables to Override where a pasted name matches an existing variable, whose type, sub-type, value and bookmark setting are then replaced. If it reports Parsing Errors or Invalid Variables, Confirm is unavailable until you fix the copied data.
  4. Select Confirm.

A variable can hold a benchmark that a chart compares its data against. In the recording, a Number variable holds a fuel-efficiency target, and the chart updates as soon as the target changes.