Working with conditions

Add a Decision to send a process one of two ways, choose how its condition rows combine, and use a Switch when there are more than two outcomes.

Help Centre › Building Processes

A Decision checks one or more conditions and sends the process down its True or False path. When there are more than two outcomes, use a Switch instead. If you are new to process maps, read Working with process maps first.

1. Add a Decision

  1. On the process map, open the Add step tab and drag Decision onto the canvas. This form opens: {{popups:decisions/add}}
  2. Give it a name that reads as a question, for example "Over the limit?".
  3. Click Condition to add a row, and fill in the variable, the operator and the value:
    {{>key-operator-value-band}}
    For variables, see Working with variables in RPAs. For operators, see the list below.
  4. Add more rows if you need them, then choose how they combine (see next section).
  5. Click Add.

You can also copy an existing Decision and edit it. Double-clicking a step duplicates it.

2. Take the True path when…

When a Decision has more than one row, Take the True path when says how the rows combine:

  • All of these (AND): every row must be true. This is the default.
  • Any of these (OR): at least one row must be true.
  • None of these: no row may be true.
  • Exactly one of these: one row, and only one, must be true.

If the answer is no, the process takes the False path.

3. Connect the True and False paths

Drag the Decision into place and draw a connection to the step that follows each answer. See Working with process maps for how.

  • The first connection you draw is DEFAULT / TRUE. The second becomes FALSE (amber).
  • To change a type, click the connection and pick another: {{popups:activities/labels}}
  • Give each connection a label such as "Yes" and "No" so the map reads well.
  • On an RPA process you can also set how long the bot waits before the next step: at least, at most, or exactly a number of seconds.

A Decision can have at most three connections out: one TRUE, one FALSE and one EXCEPTION.

4. More than two outcomes: use a Switch

A Decision only has True and False. When a value can lead several ways, for example a different path per bank, use a Switch.

  1. Open the Add step tab and drag Switch onto the canvas.
  2. In Switch on, enter the value to check, usually a variable such as {bank}.
  3. Draw a connection from the Switch to the first step of each path. All of them stay DEFAULT.
  4. Click each connection and set its label to the value it should match, for example FNB. One label can hold several values separated by commas, such as ABSA, Nedbank.
  5. Leave one connection's label empty to catch every other value.

The bot first looks for an exact match, then a match that ignores capitals and spaces, then takes the connection with no label. If nothing matches and there is no empty label, the step fails and says which value it got and which labels it had.

An older way of doing this, by leaving a Decision's value empty and labelling several connections, no longer works. A Decision with more than one TRUE path or more than three connections is rejected before the run starts. Use a Switch.

5. The full list of operators

A condition compares a variable against a value using an operator. The same operators are available when you filter a loop or a trigger.

= / !=Equals / does not equal. != is also written <>; both mean the same.
> / >=Greater than / greater than or equal to
< / <=Less than / less than or equal to
between / !betweenBetween / not between a range, written 1..10 or 1,10. The ends count as inside.
contain / !containContains / does not contain the text
startswith / !startswithStarts with / does not start with the text
endswith / !endswithEnds with / does not end with the text
in / !inIs / is not one of a comma-separated list, e.g. red,green,blue
similar / !similarIs / is not roughly the same text (at least 80% alike), useful when spelling or spacing may vary
match / !matchMatches / does not match a regular expression (regex), for advanced pattern checks
empty / !emptyIs empty / is not empty. Takes no value.

In a trigger or loop filter, a field name that does not exist makes that row fail, except with empty and !empty, where a missing field counts as empty. See Email fields for the names to use with emails.

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.