Conditions and routing: Condition and Switch
Video coming soon — step-by-step guide below
Branch on a JS condition and on an exact value.
What you need
- A scenario that already has a variable (e.g. the age from the previous video)
Steps
- Add a Condition with an expression such as
#node.12.age >= 18. - Connect the
TrueandFalseoutputs to different screens. - Add a Switch to route on an exact value, e.g. city: cases
Kyiv,Lvivanddefault. - Test both nodes in the messenger with different answers.
Resulting scenario
Condition "#node.12.age >= 18"
| True -> Switch "#node.7.city"
| | "Kyiv" -> Screen "Kyiv"
| | "Lviv" -> Screen "Lviv"
| | default -> Screen "Other cities"
| False -> Screen "18+ only"