Sub topic 8
Translating criteria and run frequency into entry conditions
This chapter assumes you can read Workflow Rule and Process Builder criteria, you know basic formula syntax, and you have a sandbox open. You will turn each criteria definition into the entry conditions of a record-triggered flow.
Where criteria go in a flow
A record-triggered flow has three settings that together replace the criteria of the older tools:
- Object and trigger. The object, and whether the flow runs on create, update, or both.
- Condition Requirements. Field conditions joined by AND, OR, or custom logic, or a formula that must evaluate to true.
- Run frequency. Whether the flow runs every time a record meets the conditions, or only when the record changes to meet them.
Mapping the three Workflow Rule evaluation options
Workflow Rules use one of three evaluation criteria. Each has a flow equivalent.
| Workflow Rule or Process Builder setting | Flow setting |
|---|---|
| Created | Trigger: A record is created |
| Created, and every time it's edited | Trigger: created or updated, run: Every time a record is updated and meets the condition requirements |
| Created, and any time it's edited to subsequently meet criteria | Trigger: created or updated, run: Only when a record is updated to meet the condition requirements |
| Process Builder "Do you want to execute the actions only when specified changes are made to the record?" | Run only when the record is updated to meet the conditions, or compare `$Record` with `$Record__Prior` |
"Only when updated to meet the condition requirements" is the safest default for migration. It stops the flow from repeating its actions on every later save.
Translating formulas
Flow formulas differ from Workflow Rule formulas in a few places. Picklists use TEXT() instead of ISPICKVAL(), and ISCHANGED() is not available. In an update-triggered flow, compare the current and prior values instead.
Workflow Rule formula:
AND(ISPICKVAL(StageName, "Closed Won"), Amount > 100000)
Flow entry condition (Formula Evaluates to True):
AND(TEXT({!$Record.StageName}) = "Closed Won", {!$Record.Amount} > 100000)
Workflow ISCHANGED(StageName) in a flow:
{!$Record.StageName} <> {!$Record__Prior.StageName}Choosing between field conditions and a formula
Use the Condition Requirements field list when the criteria are simple comparisons. Admins can read it at a glance, and the flow stays easy to maintain. Use a formula when the criteria use ISCHANGED, cross-object fields, or functions such as AND nested with OR.
Entry conditions are checked before the flow starts. A record that fails them never creates an interview, so putting the logic there is cheaper than adding a Decision element as the first step.
Common errors
- Leaving the run frequency on "every time" and sending duplicate emails or creating duplicate tasks.
- Using
ISPICKVALin a flow formula, which does not work there. - Dropping the
ISCHANGEDlogic, so the flow fires on unrelated edits.
Exercise
A Workflow Rule uses "Created, and any time it's edited to subsequently meet criteria" with the formula AND(ISPICKVAL(Status, "Escalated"), Priority__c > 3). What trigger, run frequency, and formula do you set in the flow?
Show answer
Set the trigger to created or updated, and the run frequency to "Only when a record is updated to meet the condition requirements". Use the formula AND(TEXT({!$Record.Status}) = "Escalated", {!$Record.Priority__c} > 3).