Expression Editor

The expression editor uses functions to build expressions that perform a variety of calculations and operations.

These tools have an expression editor: Action Tool, Charting Tool, Condition Tool, Dynamic Rename Tool, Error Message Tool, Filter Tool, Generate Rows Tool, Message Tool, Multi-Field Formula Tool, Multi-Row Formula Tool, Report Map Tool, Table Tool, Test Tool. Tools that use an expression editor have an additional input anchor and Question anchor when the tool is used in an app or macro workflow. Use the Interface tools to connect to a Question anchor when you want question values to be used as variables in the expression. See Interface Tools.

The expression editor in the Formula Tool looks and behaves differently than the expression editor in other tools. Functions perform the same in any tool.

Build an expression

You can build functions with the expression editor.

To build your expression, first, specify an Output Column. The Output Column will contain the results of your expression. You can overwrite an existing column or you can create a new column. Select the Output Column dropdown and choose an existing column or select Add Column and provide a name for your new column.

Once you specify an Output Column, use any of these methods to build an expression:

  • Enter the function directly in the expression editor.
  • Select the Columns and Constants button to browse through variables that can be used in the expression. Select the variable to add it to the expression editor.
  • Enter a word or phrase to view a matching list of functions.
  • Enter a [ (left bracket) to view a list of variables that you can use in the expression. Variables include...
    • Columns: Data from an incoming connection, or from a column created in a previous expression.
    • Connections from Questions: Values from an Interface tool connected to the Question anchor of a tool with an expression editor, when the tool is used in an app or macro. Use the Question anchor when you want question values to be used as variables in the expression. Go to Interface Tools for more information.
    • Constants: Global variables for a workflow that make it possible to change a value in a single location and have that change apply to the rest of the workflow. Go to Constants for more information.

Syntax Highlighting

As you edit the expression, the editor applies a color-coding scheme to its various parts to make the parts of the expression easy to distinguish. For example, functions are gold, variables are fuchsia, operators are magenta, and strings are turquoise, a blue-green.

Functions

Select Functions to browse through categories of functions. Select the function to add it to the expression editor.

Columns and Constants

Select Columns and Constants to browse data from incoming connections and global variables.

  • Existing Columns: Data from an incoming connection, or from a column created in a previous expression.
  • Connections from Questions: Values from an Interface tool connected to the Question anchor of a tool with an expression editor, when the tool is used in an app or macro. Use the Question anchor when you want question values to be used as variables in the expression. Go to Interface Tools for more information.
  • Constants: Global variables for a workflow that make it possible to change a value in a single location and have that change apply to the rest of the workflow. Go to Constants for more information.

Recent and Saved Expressions

Select Recent and Saved Expressions to browse through recent and saved expressions. Select the expression to add it to the expression editor.

Save an Expression

  1. With an expression in the expression editor, select the Save Expression (disk) icon.
  2. Enter a name for the expression and select Save.