Control Flow Activities:Switch

Control Flow Activities:Switch

Switch Statement


The 'Switch' Activity is used to identify unique branches of the selected data source. This allows for a single data source to have unique chains of Activities for every different type of values. For example, a single data source could contain logic to handle different types of events.

After opening the 'Switch' activity, you will get the following configuration panel.

Default Configuration Parameters

Field

Description

Data Source

Value to execute the matched case.

Cases

Multiple and different types of cases to perform unique operations in each case.

Executing a Switch Activity

A Simple Example to configure the 'Switch' activity in PopFlow Studio.

Switch activity can be used if some data has unique requirements. You can add multiple cases to perform a unique operation on different data.
To add the cases click on the case button. It will add a panel as shown below.

Sample Switch Activity

The best way to see the power of this activity is to step through an extended example. Let us suppose that we have three types of customers: Bronze, Gold, and Platinum. We might also have customers that have not yet been entered into a particular program. For every customer, we need to execute different activities.

We are getting the customer details from the 'HTTPS' activity. you can refer to the 'HTTPS' activity to configure it.
Now, let’s create Case Switch that branches the workflow based on the CustomerType. After creating it will look like as shown below:

 

NOTE

The default case would be to handle customers that have not yet been entered into a program.

 


    Still can’t find an answer?
      • Related Articles

      • Control Flow Activities: Stop Workflow

        Stop Workflow control flow The ‘Stop Workflow’ Activity allows you to stop the execution of the current executing workflow. After opening the 'Stop Workflow' activity, you will see the configuration panel as shown below. You don't need to configure ...
      • Control Flow Activities: Phone Number Parsing

        Phone Number Parsing control flow The ‘Phone Number Parsing' Activity provides the ability to format any phone number according to the selected ‘Phone format’ type and 'Country region code’ (optional). After opening the 'Phone Number Parsing' ...
      • Common Control Flow Uses

        5. Control Flows Activities The activities listed under Control Flows are commonly used in PopFlow. These activities allow you to create more complex and conditional workflows. These control flows enable the automation to make decisions and take ...
      • Control Flow Activities: If

        If The 'If' Activity allows you to check the data is valid, invalid, less than, more than, etc. using the conditions. If the Property matched the conditions then it will execute the THEN button activities else it will execute the ELSE button ...
      • Control Flow Activities: Next Workflow

        The ‘Next Workflow' Activity allows you to run a workflow within another workflow. It has only one child path ‘ON WORKFLOW COMPLETE’. This path becomes available after enabling “Should return to this workflow”. NOTE To use the Next Workflow activity, ...