Decision Step

The Decision Step is used to split a path into different branches depending on data related to the message. By using simple comparisons, similar to what you may be familiar with from Excel, you are able to take different actions based on information available in the Path. For example, a Journey could take one set of actions if the sender of a message was already a customer and a different set of actions if they are.

The most basic use of this step is to make an either/or decision. It is also able to handle much more complex logic and can route to an arbitrary number of different actions!

Inputs

Conditions

The first time this configuration screen is opened there will only be one condition visible. You add additional conditions by pressing the large + symbol the the right of any existing condition. Other than the first condition you can use the large - button to remove a condition as well.

Conditions are written using basic Python syntax as already discussed in the documentation for the Expression Editor. For conditions in a decision step, the expressions that you create will be evaluated as either True or False. Ideally you will create expressions that evaluate directly to True or False but be aware that Python treats any value as either True or False (see this tutorial for more information).

Let’s look at some simple examples to get you started:

For these examples we are going to use πŸ”΅ to stand in for any output from a previous step.

πŸ”΅ > 5 (where πŸ”΅ contains a number)

float(πŸ”΅) > 5 (where πŸ”΅ contains a number which is being delivered as a string)

πŸ”΅.startswith('TEST') (where πŸ”΅ is a string)

πŸ”΅ is not None (where you want to check if πŸ”΅ has any information in it)

Effects

While there are no outputs from this step, it has a big impact on what happens next. Conditions are evaluated in order and the Branch associated with a condition will be chosen as the continuation of the path for the first condition that evaluates as true.

The FIRST condition to evaluate to true will be chosen, even if multiple conditions are true, so the order of the conditions is important. Also, the last branch will be used if none of the conditions are true.

Outputs

None

Last updated