Skip to main content
You can use formulas to dynamically generate values when building Flows, configuring Field Mappings, and in many other places that require data based on variables. Formulas look like this:

Variables

All formulas use variables to calculate. The simplest formula just references the variable:
$.someVariable here is called a Locator. Locators reference a value within the variables structure. You can use . to address a field of an object and [<idx>] to address an index in an array. If fields of an object have . or [ inside them, you can escape them with \. For example, $.dot\.field.bracket\[field[0] will point to the first element in the field bracket[field array inside the dot.field variable.

List of Formulas

$concat

Concatenates two or more strings. Example:
Or a shorter version:

$tpl

Generates a string with interpolated variables. Example:

$eval

This formula evaluates a value using one of supported operators and returns true or false depending on the result. Example:
All $eval formulas have the same form:
This $eval formula will return true if the status variable has value Open. Supported operators:
  • is - value is equal to the operand.
  • isNot - value is not equal to the operand
  • isEmpty - value is empty (null, undefined, empty string, empty array, object without keys). Operand is ignored.
  • isNotEmpty - value is not empty. Operand is ignored.
  • contains - value contains the operand. For strings, it checks if the string contains the provided substring. For arrays, it checks if the array contains the provided value.
  • doesNotContain - value does not contain the operand.
  • oneOf - value is one of the values in the operand array.
  • noneOf - value is none of the values in the operand array.
  • gt - value is greater than the operand.
  • gte - value is greater than or equal to the operand.
  • lt - value is less than operand.
  • lte - value is less than or equal to the operand.

$and

Returns true if all of its arguments are true Example:
It will resolve to true if status variable is set to Open and isActive variable is true.

$or

Returns true if at least one of its arguments is true, otherwise returns false. Example:
This will return true if status variable is set to Open or isActive variable is true.

$case

Case formula selects a value based on a list of conditions. It has the following structure:
  • If filters of multiple cases match, the first one will be used
  • A case without a filter always matches.
  • Filter with zero conditions always matches.

$map

Map formula transforms a set of input values into corresponding output values.

$iterate

Iterates over an array and returns an array of values calculated for each item. Example:
The formula accepts two arguments:
  • source: the source list to iterate over. Could be a value or any formula that returns an array.
  • item: value for each item in the new list. When item value is calculated, three variables are available for it:
    • item - the current item in the source list.
    • index - the zero-based index of the current item.
    • parent - all the variables of the parent scope (i.e. variables available to the $iterate formula itself).
The resulting list will contain one item for each item of the source list.

$firstName

Extract first name from the name. Example:

$lastName

Extract last name from the name. Example:
Note: we will treat single-word names as Last Name because some applications require Last Name, but not First Name. This logic leads to fewer validation errors.

$copy

Copies another field from your value. Useful when you need the same value in two places and don’t want to define it twice.

$findExternalRecordId

Finds id of a record in an external application matching record in your application using a provided Data Link Table.

$findAppRecordId

Finds id of a record in you app that matches an external record id using a provided Data Link Table.

$firstNotEmpty

Returns the first non-null, non-undefined value from a list of candidates.

$mergeObjects

Merges multiple objects into one. Later objects override earlier ones (shallow merge).

$domainFromEmail

Extracts the domain part from an email address.

$extractDate

Extracts the date portion (YYYY-MM-DD) from a datetime value.

$extractTime

Extracts the time portion (HH:MM:SS) from a datetime value.

$dataSchemaRef

This formula is experimental. Breaking changes are possible.
Used inside Data Schemas to reference another data schema. Example:
In this example, the fields property of the schema will be equal to the schema of the contact internal data schema. Which data schemas types are available depends on the context this formula is used in. Internal Data Schemas You can reference an Internal Data Schema this way:
This schema type is always available. If used in a context of a specific tenant, it will use the tenant-specific fields.

$jsonata

If you want to apply complex data transformations, we support Jsonata expressions. Example:

$plain

This formula preserves everything inside it as is. It is useful when you need to skip evaluating formulas in a part of the expression.

$formula

This formula allows you to use a formula as a value, but it still evaluates $var inside it. It is useful when you want to produce a formula dynamically, parametrized by variables. This is, for example, used in connectors when mapping fields to/from unified fields when you want the result to be a formula.