Condition Step
Send a workflow down one of two paths based on a Member's answer or a score, so each Member gets the Steps that fit them.
Give Different Members Different Paths
A Condition Step checks something about the run, such as a score or an answer, and sends the workflow down its True branch or its False branch. Use it when Members need different help: a short plan for a beginner and a detailed one for someone further along, or a sales follow-up only for people over a budget. Your Members never see the Condition Step. They see only the Steps on the path they take.
Add a Condition Step
Spark doesn't add Condition Steps, so you add them in the workflow editor.
If Spark built this workflow, a later Spark change replaces every Step, including a Condition Step you add here. Add it once you're done asking Spark for changes, and add it again after any later Spark change. See What a Spark Change Replaces.
Add the Step
Click Condition in the Logic group of the Steps list. Put it after the Steps that collect or work out what it checks.
Write the expression
In Expression, write the check. See Write the Expression.
Connect both branches
The Step has two dots at the bottom, labeled True and False. Drag from each to the first Step of its path. See Building a Workflow on the Canvas.
Test each path
Click Preview and run the workflow once with answers that take the True branch and once with answers that take the False branch. See Testing and Publishing a Workflow.
Write the Expression
The expression is a check that comes out true or false. Click Insert Variable to add your Member's answer from an earlier Step under Input Fields, or an earlier Step's result under Step Outputs, then write the comparison around it. User Knowledge isn't available here. See Variables.
In these examples, a name in curly brackets, such as {{budget}}, stands for a variable you inserted:
| Expression | True when |
|---|---|
{{budget}} > 1000 | The Budget answer is over 1,000. |
{{readiness_score}} >= 50 and {{readiness_score}} < 80 | The Readiness Score Step's result is from 50 up to 79. |
equalText({{plan_tier}}, "Pro") | The Plan Tier answer is exactly Pro. |
You can use:
- Comparisons:
>,<,>=,<=,==and!=. - Combining checks:
and,orandnot. - Math:
+,-,*,/and^for powers, and functions such asmin,maxandround. - Text:
equalText(a, b)to check whether two pieces of text are the same.
To compare text, use equalText. A comparison such as {{plan_tier}} == "Pro" works only on numbers, so with a text answer the Step fails. When a Condition Step fails, the run doesn't stop, and the Steps on both branches run. Test each branch with Preview before you publish.
If ThoughtFlow can't read the expression, a message appears in red under it a moment after you stop typing. Fix it before you test.
How the Step Decides
- False: the result is
false,0, empty, or the textfalseor0. - True: anything else, including any other text.
A checkbox answer is the text "Yes" or "No", and both count as true on their own. Compare it instead: equalText({{wants_a_call}}, "Yes").
An answer your Member left empty counts as 0 in a comparison, so {{budget}} > 1000 is false when Budget is blank.
What Happens on the Path Not Taken
The Steps on the branch the run doesn't take are skipped, and they leave your Member's progress list. Variables from those Steps have no value.
Branches can join again. A Step with a connection from each branch runs whichever branch the run takes.
Connect Both Branches Before You Publish
A Condition Step needs both branches connected. Until they are, its card shows a warning, and Preview and Publish don't work:
| Warning | What to do |
|---|---|
| "Connect the True handle to a downstream step." | Drag from the True dot to a Step. |
| "Connect the False handle to a downstream step." | Drag from the False dot to a Step. |
| "Add an expression to determine which branch this step takes." | Write the Expression. This one doesn't stop you from publishing, but the Step can't decide without it. |
If one branch has nothing to do, connect it to the Step where the two paths meet again.
Hide from Progress List starts on for a Condition Step, because it works behind the scenes. See Step Types.
Tips for Condition Steps
- Score first, then branch. Work out a number with a Compute Step, then check it here. A number is easier to test than a long text answer. See Compute Step.
- Branch on answers that can't vary. A Select or Checkbox answer gives you exact values to compare. A typed answer might be spelled many ways.
- Test every path. Run Preview once for each branch, with answers you chose to take it.