Skip to content

Formulas

A formula is a short JavaScript expression, like a spreadsheet formula. It sees:

Name What it is
row The source row. Columns are available by their original name and a safe identifier: row["First Name"] or row.First_Name. A column named exactly like the identifier keeps it, so beside a First_Name column, read First Name as row["First Name"].
helpers Your organisation’s helper libraries, each under its namespace: helpers.<namespace>.<name>(...). Core helpers are also available directly: helpers.date(...).
rec This row’s records in the CRM, by module singular: rec.Account.id, rec.Contact.Email. Called rec unless your organisation’s registry names it otherwise.
old, next Only inside an update guard: the matched record and the payload about to be written.

Some examples:

helpers.join(' ', row.First, row.Last)
helpers.date(row.Start, 'MM/DD/YYYY')
row.Amount ? helpers.num(row.Amount) * 1.1 : 0
rec.Account.id

A formula that reads rec resolves during the run, once the records it refers to exist. If it refers to a module written later in the same row, or to a generated field such as an autonumber, the value is patched after save — on a record the row makes, or one it finds and updates (under Skip it a found record is left as it is, after-save fields included).

Report a problem with this page

sloose.com