Skip to content

Recipes

Formulas for common tasks. Field names are examples; use your own.

Text

TaskFormula
Full name from two fields, without extra spacesTRIM(firstname + " " + lastname)
Clean an e-mail addressLOWERCASE(TRIM(email))
Default for an empty valueCOALESCE(phone, mobile, "unknown")
First 100 characters (column length limits)LEFT(description, 100)
Remove dashes from a numberREPLACE(tax_id, "-", "")
Postal code from “00-950 Warsaw”LEFT(address_line, 6)
Text with a line breakstreet + CHR(10) + city
Zero-padded codeFORMAT(customer_no, "000000")

Numbers

TaskFormula
Decimal comma from a CSV file or ExcelNUMBER(amount, ",")
Round to two decimalsROUND(price * qty, 2)
Percentage to a fractiondiscount / 100
Sum of several fields, ignoring empty onesSUM(ARRAY(q1, q2, q3, q4))
Empty instead of zeroIF(amount = 0, NULL, amount)

Dates

TaskFormula
Date in a fixed formatDATETIME(birth_date, "MM/dd/yyyy")
End of a 30-day trialADDDAYS(start_date, 30)
Age in yearsFLOOR(DATEDIFFDAYS(birthdate, TODAY()) / 365.25)
Today as text for a file or a nameFORMAT(TODAY(), "yyyy-MM-dd")
Only dates in the futureIF(due_date > NOW(), due_date, NULL)

Conditions

As the Run only if condition of a step:

TaskCondition
Only rows with an e-mail addressISNOTNULL(email)
Only active customersstatus = "Active"
Only when the record does not exist yetISNULL(LOOKUP("CRM", "contact", "emailaddress1", "contactid", email))
Only large orders from Polandamount >= 1000 AND country = "PL"

Choices and yes/no

TaskFormula
Map codes to a choice valueIF(type = "C", 1, IF(type = "S", 2, 3))
A choice by its label"Preferred Customer" (the label is converted to its value)
Yes/no from “Y”/“N”flag = "Y"
Several values of a multi-select choice"Red;Blue"

Lookups and references

TaskFormula
Link to an account found by its numberCreateEntityReference("account", LOOKUP("CRM", "account", "accountnumber", "accountid", customer_no))
Link to the record created by step 1V_1_ID
Owner by the user’s e-mailCreateEntityReference("systemuser", LOOKUP("CRM", "systemuser", "internalemailaddress", "systemuserid", owner_email))
A value from a mapping table in SQL ServerLOOKUP("Warehouse", "dbo.CountryMap", "OldCode", "NewCode", country)
A value from a CSV lookup fileLOOKUP("Codes", "", "code", "name", code)
E-mail recipients (party list)CreatePartyList(CreateEntityReference("contact", contact_id), CreateEntityReference("systemuser", user_id))
GUID of a lookup, for a SQL columnGetGuid(parentcustomerid)

Ids

TaskFormula
A new GUID for each rowNEWGUID()
A key from two fieldsUPPERCASE(country) & "-" & customer_no
Last updated on