Formulas
Formulas let you calculate values, transform data, and make decisions in your workflows. They combine form data, variables, and built-in functions to create dynamic content that adapts to each workflow run.
Formulas can be used anywhere you need computed values — in document bindings, email content, HTTP request bodies, and conditional logic.
Using Formulas
Formulas are entered using a formula editor that provides autocomplete and validation.
Type @ to insert variables, or start typing a function name to see available options.
Formulas can be used in:
- Document tag bindings — Calculate values to populate document templates
- Conditional logic — Evaluate conditions in split and condition nodes
- Email content — Create dynamic subject lines and body text
- HTTP requests — Build request URLs, headers, and body content
Expression Types
Math Operations
Formulas support standard mathematical operations:
- Basic arithmetic: Price * 1.1
- Grouping: (Quantity * Price) - Discount
- Functions: ,SUM(1, 2, 3),AVERAGE(Math Score, English Score)ROUND(Total, 2)
Text Operations
Transform and combine text values:
- Concatenation: "Hello " + First Name + " " + Last Name
- Functions: ,UPPER(Name),TRIM(Address)STARTS_WITH(Text, "start")
Conditional Logic
Use IF-THEN-ELSE expressions along with comparison and logical operators such as =, !=, >, <, AND, OR, and NOT to create dynamic values based on conditions:
- Simple condition: IF Age >= 18 THEN "Adult" ELSE "Minor"
- Complex logic: IF (Status = "urgent" AND Priority > 5) THEN "High" ELSE "Normal"
- Nested conditions: IF Score > 90 THEN "A" ELSE IF Score > 80 THEN "B" ELSE "C"
Built-in Functions
Formulas include a library of built-in functions organized by category:
Math functions
| Function | Description | Examples |
|---|---|---|
| SUM | Sum of the arguments | SUM(1, 2, 3) → 6 |
| AVERAGE | Average of the arguments | AVERAGE(1, 2, 3, 4) → 2.5 |
| COUNT | Count numbers | COUNT(1, 2, 3) → 3 |
| MAX | Maximum value | MAX(1, 5, 3) → 5 MAX(-5, -1, -10) → -1 |
| MIN | Minimum value | MIN(1, 5, 3) → 1 MIN(-5, -1, -10) → -10 |
| ROUND | Round to specified decimal places | ROUND(3.14159, 2) → 3.14 ROUND(2.5) → 3 ROUND(2.4) → 2 |
| ROUNDUP | Round up to specified decimal places | ROUNDUP(3.14159, 2) → 3.15 ROUNDUP(2.1) → 3 |
| ROUNDDOWN | Round down to specified decimal places | ROUNDDOWN(3.14159, 2) → 3.14 ROUNDDOWN(2.9) → 2 |
| ABS | Absolute value | ABS(-5) → 5 ABS(5) → 5 |
Text functions
| Function | Description | Examples |
|---|---|---|
| UPPER | Convert to uppercase | UPPER("Hello World") → "HELLO WORLD" |
| LOWER | Convert to lowercase | LOWER("Hello World") → "hello world" |
| TRIM | Remove leading and trailing whitespace | TRIM(" hello ") → "hello" |
| LEFT | Left substring | LEFT("Hello World", 5) → "Hello" LEFT("Test", 10) → "Test" |
| RIGHT | Right substring | RIGHT("Hello World", 5) → "World" RIGHT("Test", 10) → "Test" |
| MID | Middle substring | MID("Test", 1, 4) → "Test" MID("Hello World", 7, 5) → "World" |
| CONTAINS | Check if string contains text | CONTAINS("Hello World", "World") → true CONTAINS("Hello World", "Universe") → false |
| STARTS_WITH | Check if string starts with text | STARTS_WITH("Hello World", "Hello") → true STARTS_WITH("Hello World", "Universe") → false |
| ENDS_WITH | Check if string ends with text | ENDS_WITH("Hello World", "World") → true ENDS_WITH("Hello World", "Universe") → false |
| SUBSTITUTE | Replace text in string. Replace all instances of the old text with the new text. Optionally, limit the number of replacements to the specified number. | SUBSTITUTE("code c", "c", "m") → "mode m" SUBSTITUTE("A B A B", "A", "-", 1) → "- B A B" |
| REPLACE | Replace text in string. Starting at the specified position, replace the specified number of characters with the new text. | REPLACE("Hello World", 1, 5, "Hi") → "Hi World" |
General purpose functions
| Function | Description | Examples |
|---|---|---|
| IS_EMPTY | Check if value is empty | IS_EMPTY("") → true IS_EMPTY(0) → false IS_EMPTY(" ") → false IS_EMPTY(FALSE) → false |
| LEN | Length of string | LEN("hello") → 5 LEN("") → 0 |