VOGO Voice – Knowledge Base

Switch

Estimated reading time: 2 min

Components form the key identifiable parts of the interaction builder platform. The assembly of the series of components implements the input and logical conditions the user experiences throughout a conversation. Switch is one of the many components used in the flow within the interaction builder platform. The yellow color assigned to the Switch card suggests that it is a condition or decision-making component that adopts the principle underlying a programming switch statement. 

This user-centric guide highlights the configuration of Switch component when used in an interaction flow thereby focusing on its core functionality. To help you understand its anatomy, the comprehensive guide outlines when to use the component in addition to its relevance within a session.

Prerequisites 

How to access the ‘Switch’ component

Navigate to the interaction builder platform of VOGO Voice to access the Switch under the Components section. Click and drag the component onto the flow canvas.

Click the Edit symbol on the top right-hand side of the component card to define cases by adding values.  

Purpose of ‘Switch’ Component

Switch component employs a choice based mechanism that permits to switch paths within an interaction flow based on choices. When a decision across multiple choices is required, Switch executes statements by matching/comparing the values added within the component with the user’s choices/input cases.

The Configuration window of Switch component has dual sections. The Value field is set to capture the incoming choice/user-input value also known as switch input that controls the flow of execution of multibranched paths. The section titled Cases serves to add values that will be displayed as case labels on the component card. Every time a new value is added, it shows up as a case label with an anchor symbol from which a path of execution can be defined thereby supporting multiway branching.   

Note: You can have any number of cases within a switch component. Duplication of case values are not permitted. 

In the layout of the Configuration window, there is the option to choose the relevant data type for both switch input and case values from their respective drop-down list. To know more about data types, click here.

👍 Note: The data type of the case value must be the same as that of the actual incoming value captured via switch input.

Switch component aids in handling multiple option type interactions where the users are allowed to choose only one option from the given choices. It provides an easy way to dispatch execution to different paths based on the switch input. When the component is put to function, the input value is evaluated and compared with the values of each case label. If there is a match, the corresponding path chained to the matching case label will be executed. 

A switch component will have an optional Default case which is called to action only at the very end after evaluating all the other case values. If the input value fails to match with any of the case values, the control is transferred to the Default case, if given, which will initiate the execution of the path linked to it.

Tags:
Was this article helpful?
Dislike 0
Previous: Request Permission
Next: Check Variable