All templates
Flow ControlIntermediate
Use the AND Operator in Conditionals
Robomotion•Updated 6 months ago

Overview
Shows how to branch a flow only when two conditions are both true using a Switch node with a combined predicate.
Use the AND Operator in Conditionals
Logical operators enable users to create complex logical expressions and implement advanced logic in their flows. For example, they can use the "AND" logical operator to create expressions that are true when all the provided conditions are valid.
What Use the AND Operator in Conditionals can do
- Seed inputs (
Core.Programming.Function) —msg.tool = 'Robomotion'; msg.company = 'Robomotion Inc.';. - AND test (
Core.Programming.Function,outputs: 2) —return (msg.tool === 'Robomotion' && msg.company === 'Robomotion Inc.') ? [msg, null] : [null, msg];. - Port 0 shows
Core.Dialog.MessageBoxtitledFlow ran successfully!with bodyAll the provided conditions were true.(optType: 'info'). - Port 1 goes straight to
Core.Flow.Stop(no else branch).
Behind the scenes
- The teaching point is that every predicate must be true to enter the then-branch. Learners often assume
ANDshort-circuits are distinct fromOR— emphasise the truth-table. - Both seeded values deliberately match, so the happy-path dialog fires on first run; flip either assignment to see the else path short-circuit to
Core.Flow.Stop.