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
Formula dropdown

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

FunctionDescriptionExamples
SUMSum of the argumentsSUM(1, 2, 3) → 6
AVERAGEAverage of the argumentsAVERAGE(1, 2, 3, 4) → 2.5
COUNTCount numbersCOUNT(1, 2, 3) → 3
MAXMaximum valueMAX(1, 5, 3) → 5
MAX(-5, -1, -10) → -1
MINMinimum valueMIN(1, 5, 3) → 1
MIN(-5, -1, -10) → -10
ROUNDRound to specified decimal placesROUND(3.14159, 2) → 3.14
ROUND(2.5) → 3
ROUND(2.4) → 2
ROUNDUPRound up to specified decimal placesROUNDUP(3.14159, 2) → 3.15
ROUNDUP(2.1) → 3
ROUNDDOWNRound down to specified decimal placesROUNDDOWN(3.14159, 2) → 3.14
ROUNDDOWN(2.9) → 2
ABSAbsolute valueABS(-5) → 5
ABS(5) → 5

Text functions

FunctionDescriptionExamples
UPPERConvert to uppercaseUPPER("Hello World") → "HELLO WORLD"
LOWERConvert to lowercaseLOWER("Hello World") → "hello world"
TRIMRemove leading and trailing whitespaceTRIM(" hello ") → "hello"
LEFTLeft substringLEFT("Hello World", 5) → "Hello"
LEFT("Test", 10) → "Test"
RIGHTRight substringRIGHT("Hello World", 5) → "World"
RIGHT("Test", 10) → "Test"
MIDMiddle substringMID("Test", 1, 4) → "Test"
MID("Hello World", 7, 5) → "World"
CONTAINSCheck if string contains textCONTAINS("Hello World", "World") → true
CONTAINS("Hello World", "Universe") → false
STARTS_WITHCheck if string starts with textSTARTS_WITH("Hello World", "Hello") → true
STARTS_WITH("Hello World", "Universe") → false
ENDS_WITHCheck if string ends with textENDS_WITH("Hello World", "World") → true
ENDS_WITH("Hello World", "Universe") → false
SUBSTITUTEReplace 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"
REPLACEReplace 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

FunctionDescriptionExamples
IS_EMPTYCheck if value is emptyIS_EMPTY("") → true
IS_EMPTY(0) → false
IS_EMPTY(" ") → false
IS_EMPTY(FALSE) → false
LENLength of stringLEN("hello") → 5
LEN("") → 0

Next Steps

Formulas - TemplateDocs Documentation