In a Branch/Switch action, the condition property is compared to multiple potential options. Each option is known as a case.

When a match is found, the logic of your conversational AI application continues down the relevant path. This action is useful when you want to handle multiple scenarios in a single decision point.

In the following example we'll add a Branch Switch action that checks what type of fruit the user has selected from a multiple choice prompt. This value is stored in a user scoped variable user.selection.

To add a Branch Else action perform the following steps:

  1. Select Create a condition and Branch: Switch (multiple options).

Untitled

  1. Select the newly added action and set the value for condition property to user.selection.

Untitled

  1. Add a case to this action by clicking in the textbox with the watermark "Add new value". Supply apple and press return. The case is added to the list and a new empty branch is added to Branch/Switch action:

Untitled

  1. Repeat this process and add 2 more cases for orange and banana: