Use Field Values and Formulas
Most automation settings can use values from the record or from earlier steps instead of fixed text. This guide covers inserting those values and calculating new values with the Formula Builder action.
Prerequisites
- An automation with a trigger and at least one step before the place you want to insert a value.
- For formulas, a field on the entity to store the result.
Insert a value from an earlier step
Click + beside the setting
Text, number, email, rich text, and file settings show a + button. Click it.
Pick the step
The left column, Use data from..., lists the trigger and every step that runs before this one. Click the step that has the value. In a Send Email message you also see Insert a link.
Pick the field
Under Choose Data, search for and click the field. User fields offer the plain value, (Name), and (Email). Generated outputs, such as Generated PDF or the records from Find Records, are listed too.
Check the chip
The value appears as a chip inside the setting. You can type text around it and insert several values in the same setting.
Only earlier steps are offered
A step can use values from the trigger and from steps above it on the same path. A step inside a Repeating Group can also use the current record of the loop. If you move or delete a step that other steps take values from, update those settings; publishing is refused when an email uses a value from a step that is missing or comes later.
Calculate a value with Formula Builder
Add a Formula Builder step
Click + and choose Formula Builder. Enter a Name, and set Entity selection and Record Id to the record that will receive the result.
Write the formula
In Formula, type a letter to see matching functions, or type { to insert a field of the record. Click + to insert a value from an earlier step.
Choose the Output Field
Pick the field where the result is saved.
Save
Click Save Changes.
Formula functions
| Category | Functions |
|---|---|
| Conditional | IF(condition, value_if_true, value_if_false), SWITCH(condition1, result1, ..., default) |
| Math | SUM, COUNT, AVG, MIN, MAX, ROUND(number, digits), ABS, DIVIDE, MULTIPLY, MINUS, MOD, POWER, SQRT, LOG |
| Logical | AND, OR, NOT, XOR, EXACT(value1, value2) |
| Text | CONCATENATE, UPPER, LOWER, LEN, IN(value, [list]), LEFT, RIGHT, MID, TRIM, REPLACE, REPT, SEARCH, SUBSTITUTE, TEXT(value, format), STR, VALUE |
| Date and time | TODAY(), NOW(), DATE(year, month, day), DATEVALUE, DATEADD(date, amount, unit), ADD_DAYS, SUBTRACT_DAYS, DATEDIFF(date1, date2, unit), DAYS, WORKDAY(date, workdays), WORKDAYS(start, end), MONTH, YEAR, DAY, HOUR, MINUTE, SECOND, HOURS_DIFF, MINUTES_DIFF, ADD_MINUTES, SUBTRACT_MINUTES, FORMAT_DATE(date, format), IOSWEEKNUM, WEEKNUM |
| Lists | APPEND, EXTEND, REMOVE |
| Constants | PI(), TRUE(), FALSE() |
DATEADD accepts the units minutes, hours, days, months, or years. WORKDAY and WORKDAYS skip weekends.
Formula fields versus Formula Builder
If a value should always be recalculated whenever the record changes, a formula field on the entity may be simpler. See Add a Formula Field. Use Formula Builder when the calculation belongs to a specific moment in a workflow, such as setting a due date when a review is created.
Example
When a Plan Review record is created, set its Due Date to 10 working days after creation.
| Setting | Value |
|---|---|
| Trigger | When record is created, entity Plan Review |
| Action | Formula Builder |
| Name | Set review due date |
| Entity selection | Plan Review |
| Record Id | Trigger step's Record ID |
| Formula | WORKDAY(TODAY(), 10) |
| Output Field | Due Date |
Common mistakes
- Typing a field name as plain text in a formula. Insert it with
{or + so it is recognized as a field. - Writing the result to a field of the wrong type, for example a date calculation into a text field.
- Inserting a value from a step on a different branch of an IF/ELSE. Only steps that ran earlier on the same path have values.