How to add a yes/no decision
A condition compares fields on the triggering record and sends the workflow down its Yes path or its No path.
A condition is the yes/no step in a What are workflows?. It compares something on the record that started the workflow and splits the flow in two. You add it on the canvas in Brain › Workflows.
A condition is what turns "when a repair is logged" into "when an urgent repair is logged".
How do you add one?
Open Conditions on the step library's rail. The cards are grouped under each kind of record, and each one compares a single field, such as Repair Urgency in the Repair group.
Pick a card from the group named after your trigger's record. In its options, choose a Comparison, then fill in the value in the box below it. Connect your trigger's right-hand dot to the condition's left-hand dot.
The library shows conditions for every kind of record that can start a workflow. A card from another group shows the message "This step compares a … detail, but the trigger is not a … any more." Delete it and pick one from your trigger's group.
How do you check several things in one step?
Use Compare any field, in the Advanced group. It starts with no rules: press + Add a rule, choose a field, choose a comparison and give a value, then add as many more as you need.
Set Match to decide how the rules combine.
- All of these takes the Yes path only when every rule matches.
- Any of these takes the Yes path when at least one rule matches.
The card sums it up, for example "2 rules, all must match". Take a rule out with the Remove link under it.
What are the Yes and No dots?
A condition has two dots on its right edge: a green Yes at the top and a red No below it. The dot a line leaves from decides which branch it belongs to.
Drag from the green dot to build the path for when the comparison matches. Drag from the red dot to build the path for when it does not.
When a workflow does the right thing at the wrong time, check which dot each line starts from before you check anything else. Once the lines are drawn, a wrong dot is easy to miss.
Do you have to use both branches?
No. Most workflows use Yes only and leave No unconnected, which ends the flow there.
Use No when there is a real alternative. At Fairgreen Golf Co., an urgent repair creates a task for the warehouse lead on the Yes path, and any other repair notifies the repairs team on the No path.
You can draw more than one line from the same dot. Every step on the branch that is taken runs.
What can you compare?
Fields on the record that started the workflow. Each field offers the comparisons from this list that suit its kind.
- Text: is, is not, contains, is empty, is not empty.
- Numbers and money: is, is not, is greater than, is at least, is less than, is at most, is empty.
- Dates: is, is before, is after, is empty, is not empty. Pick the date from the calendar.
- Choices: is, is not, is empty.
On one of your own Objects, type a choice exactly as it is spelled in the field's options, capitals included, because is matches the whole value. Contains ignores capitals. Type numbers and money as plain digits, such as 1250, with no currency sign or thousands comma.
Why did publishing refuse my condition?
Publishing lists each problem in plain English and outlines the step on the canvas in red.
- A condition with no rules. The message is "Condition: add at least one rule, or it will always take the Yes path."
- No comparison chosen. The message starts "Condition: choose a comparison for" and names the field.
- A line out of a condition that does not start on Yes or No. Delete the line and draw it again from the green or red dot.
Check the value too, before you publish. A card that reads "is …" has no value yet, so fill the box in. See How to publish, switch on and read a run.
How do you check which way it went?
Open the workflow's Runs tab and expand a run. Each step has its own card, and the condition's card says whether it matched and carried on down the Yes path, or did not match and carried on down the No path.
That is the fastest way to debug a workflow that runs but does the wrong thing. Usually the comparison was not what you thought, such as a choice typed with different capitals.
Can you chain conditions?
Yes. Connect one condition's green Yes dot to a second condition, and the flow carries on only when both match.
For several rules about the same record, one Compare any field step is tidier than a chain, and it is easier to read six months later. Use a chain when each answer needs its own No path.