Use functions to build expressions that perform a variety of calculations and operations.
Types of Functions
The following function types are available for transforming and your data. The type of data determines the functions you can use. See Data Types.
Conditional functions allow you to perform an action or calculation using an IF statement. Learn more in the Conditional Functions article.
Conversion functions convert numbers to strings or strings to numbers. Learn more in the Conversion Functions article.
DateTime functions allow you to perform an action or calculation on a date and time value. Learn more in the DateTime Functions article.
A file function builds file paths, checks to see if a file exists, or extracts a part of a file path. Learn more in the File Functions article.
A finance function applies financial algorithms or mathematical calculations. Learn more in the Finance Functions article.
A math function performs mathematical calculations. Learn more in the Math Functions article.
A bitwise function operates on one or more bit patterns or binary numerals at the level of their individual bits. Use a bitwise function to manipulate values for comparisons and calculations. Learn more in the Math:Bitwise Functions article.
A minimum or maximum function finds the smallest and largest value of a set of values. Learn more in the Min/Max Functions article.
An operator is a character that represents an action. Use an arithmetic operator to perform mathematical calculations or a Boolean operator to work with true/false values. Learn more in the Operators article.
A spatial function builds spatial objects, analyzes spatial data, and returns metrics from spatial fields. Learn more in the Spatial Functions article.
These functions perform a variety of specialized actions and can be used with all data types. Learn more in the Specialized Functions article.
A string function performs operations on text data. Use a string function to cleanse data, convert data to a different format or case, compute metrics about the data, or perform other manipulations. Learn more in the String Functions article.
A test function performs data comparisons. Use a test function to identify the data type of a value, or determine if a value exists. Learn more in the Test Functions article.
The Expression Editor
Functions can be built within the expression editor.
Build an Expression
Use any of these methods to build an expression:
- Type directly in the expression editor.
- Click Variables to browse through variables that can be used in the expression. Double-click the variable to add it to the expression editor.
As you edit the expression, the editor applies a color coding scheme to its various parts (e.g. functions are gold; variables are fuchsia, operators are magenta, and strings are turquoise, a blue-green) making the parts of the expression easy to distinguish.
- Fields: 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. See Interface tools.
- 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. See Constants.
- Click Functions to browse through categories of functions. Double-click the function to add it to the expression editor.
- Click Saved Expressions to browse through recent and saved expressions. Double-click the expression to add it to the expression editor.
Save an Expression
- With an expression in the expression editor, click Save.
- Type a name for the expression and click OK.
Tools with an Expression Editor
The following tools include an expression editor. 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 for more information.