Input Switch Operator

Prev Next

The Input Switch operator lets you alternate between two inputs in the same flow of a Data Workflow. To begin, you'll connect two Input-type operators to your Input Switch operator. Then, you'll set a condition for the Input Switch operator to determine which set of input data to use. When your condition is True, the operator chooses the input connected to its upper input port. When your condition is False, the operator chooses the input connected to its lower input port.

You can think of an Input Switch operator as a reverse Decision operator. A Decision operator has two possible paths for your data to follow. The Decision operator uses a condition to determine which path to send your data. In contrast, the Input Switch operator has one possible path with two potential sources of data. The Input Switch operator uses a condition to determine which set of data to send to that path.

Input Switch operators only work in a forward direction. So, the operator cannot update or edit any data passed to it through its input ports.

You’ll find the Input Switch operator under the Gateways group to the left of the Data Workflow canvas.

About the Info Window

And here's a breakdown of each setting in the Info window:

Setting

Description

Category

Grayed out and non-adjustable setting indicating the operation type.

Label

Sets the label for your operator, displaying below the operator on your Data Workflow canvas.

This field is optional, but set a label if you use more than one of the same operator type. A label helps you identify your operators without opening any Info windows.

Do Not Sanitize Formula

When this checkbox is clear, the operator cleans values coming into or defined in the operator. For example, removing special characters. Some of those special characters include ', $, #, and &amp. The operator also cleans up complex values. For example, logically breaking up strings of numbers and letters using underscores. A sample module ID can go from 5f6b4cdfabf886024d4de2d3 to 5f_6b_4cdfabf_886024d_4de_2d_3.

Sanitizing improves performance. But it can also lead to unexpected data behavior. If your Create Field is not behaving as expected, try selecting this box. When selected, the operator uses your values and expressions as-is. This is best when working with complex values or values that should remain unchanged.

By default, this setting is selected, which means the operator does not attempt to sanitize.

Preserve Argument Type

When selected, this setting ensures the argument data type is respected when the operator executes.

Condition

Here, you'll set the expression that the operator runs your data against. You'll use <, >, =, >=, or <= to set your expression.

To use another operator as an argument, connect the operator to the argument port. Then, enter _arg here.

Adding an Input Switch Operator

Let’s say you have two Text Field components whose data you’ll use from either of them in your Data Workflow component. You can add a set of Radio Buttons components to let your end-user choose which field passes through your Data Workflow. You'll connect both Text Field components as inputs to the Input Switch operator. Then, you'll connect your Radio Buttons component to the argument port of the operator. You'll configure your Data Workflow to display your end-user's selection in a third Text Field component.

This is a simplified example to demonstrate the functionality of this operator. For a more detailed use case, reference our Input Switch Use Case: Creating a Comment Array article.

Configure the Columns Component

Your Columns component acts as a container for the components that follow.

  1. Drag and drop a Columns component onto your canvas.

  2. In the Property ID field, enter colInputs.

  3. Under Formatting, click   (two columns).

                                               

  4. Click Save & Close.

Configure the Text Field Components

Next, let's add input and output fields to your module. You'll use Text Field components to collect your end-user's name and job title. And you'll use a third Text Field component to show the output of your Data Workflow.

  1. Drag and drop three Text Field components onto your canvas, placing them in the left-hand column of the colInputs Columns component.

  2. Enter the following Property ID and Label Text for each component:

    Property ID

    Label Text

    name

    Name

    jobTitle

    Job Title

    output

    Output

  3. Click Save & Close as you add and configure them.

Configure the Radio Buttons Component

To let your end-user choose which input they see, you'll add a Radio Buttons component. You'll set this as the argument for your Input Switch in the next step.

  1. Drag and drop a Radio Buttons component onto your canvas, placing it in the right-hand column of the colInputs Columns component.

  2. In the Property ID field, enter switchArgument.

  3. In the Label Text field, enter Show:.

  4. Set your Option Label and Value to Store in Submission Data as shown below:

    #

    Option Label

    Value to Store in Submission Data

    1

    Name

    name

    2

    Job Title

    jobTitle

                                               

  5. Click Save & Close.

Configure the Data Workflow Component

Now, you’ll set your Name and JobTitle Text Field components as inputs for your Input Switch operator. Your switchArgument Radio Buttons component serves as the argument. Then, your Input Switch operator outputs the result to your output Text Field component.

  1. Drag and drop a Data Workflow component onto your canvas, placing it below your colInputs Columns component.

  2. In the Canvas Label Text and Property Name fields, enter dwfSwitch.

Configure the First Input Operator

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    name

    Required

    No

    Source

    Default

Configure the Second Input Operator

  1. Drag and drop a second Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    jobTitle

    Required

    No

    Source

    Default

Configure the Third Input Operator

  1. Drag and drop a third Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    switchArgument

    Required

    Yes

    Source

    Default

Configure the Input Switch Operator

  1. Drag and drop an Input Switch operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input Switch

    Label

    _arg='name'

    Do Not Sanitize Formula

    Yes (checked)

    Preserve Argument Type

    Unchecked (no)

    Condition

    _arg='name'

Connect the output port (right) of the name Input operator to the upper input port (left) of the Input Switch operator.

  1. Connect the output port (right) of the jobTitle Input operator to the lower input port (left) of the Input Switch operator.

  2. Connect the output port (right) of the switchArgument Input operator to the argument port (top) of the Input Switch operator.

Configure the Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    output

    Action

    value

  3. Connect the output port (right) of the _arg='name' Input Switch operator to the input port (left) of the output Output operator.

  4. Click Save.

Configure the Initializer Component

You'll notice this Initializer component performs two operations. First, it clears your output Text Field component so it's ready for a new value each time your Data Workflow runs. Second, it starts the dwfSwitch Data Workflow. You'll add a Button component to trigger your Initializer in the next step.

  1. Drag and drop an Initializer component onto your canvas, placing it above your dwfSwitch Data Workflow component.

  2. In the Property ID and Canvas Label Text fields, enter initSwitch.

  3. Set the Trigger Type as Manual.

  4. In the Outputs table, enter the following:

    #

    Property ID

    Type

    Value

    1

    output

    clear

    yes

    2

    dwfSwitch

    trigger

    GO

  5. Click Save & Close.

Configure the Button Component

Lastly, let's add a Button component to begin the operation. When your end-user clicks this button, it triggers your initSwitch Initializer component, which clears your output Text Field component and begins the dwfSwitch Data Workflow.

  1. Drag and drop a Button component onto your canvas, placing it between your jobTitle and output Text Field components.

  2. In the Property ID field, enter btnSwitch.

  3. In the Label Text field, enter Start Input Switch.

  4. Set the Action Type to Event.

  5. In the On Click field, enter initSwitch.

    This ties your Button component to the Initializer component you'll add in the next step. What you enter here must match the Property ID you assign to that Initializer.

  6. Click Save & Close.

  7. Save your module.

Here's how the completed example looks in the Module Builder:

Here's how the completed example looks in Express View:

Now it's time to test your Data Workflow. Preview your module in Express View and enter a name and job title. Then, make a selection from your radio buttons and click the button. You'll see the selected value in your Output field.

The Input Switch operator lets you alternate between two inputs in the same flow of a Data Workflow. To begin, you'll connect two Input-type operators to your Input Switch operator. Then, you'll set a condition for the Input Switch operator to determine which set of input data to use. When your condition is True, the operator chooses the input connected to its upper input port. When your condition is False, the operator chooses the input connected to its lower input port.

You can think of an Input Switch operator as a reverse Decision operator. A Decision operator has two possible paths for your data to follow. The Decision operator uses a condition to determine which path to send your data. In contrast, the Input Switch operator has one possible path with two potential sources of data. The Input Switch operator uses a condition to determine which set of data to send to that path.

Input Switch operators only work in a forward direction. So, the operator cannot update or edit any data passed to it through its input ports.

You’ll find the Input Switch operator under the Gateways group to the left of the Data Workflow canvas.

About the Info Window

Learn more about each setting in the Input Switch operator's Info window:

Setting

Description

Category

Grayed out and non-adjustable setting indicating the operation type.

Label

Sets the label for your operator, displaying below the operator on your Data Workflow canvas.

This field is optional, but set a label if you use more than one of the same operator type. A label helps you identify your operators without opening any Info windows.

Do Not Sanitize Formula

When this checkbox is clear, the operator cleans values coming into or defined in the operator. For example, removing special characters. Some of those special characters include ', $, #, and &amp. The operator also cleans up complex values. For example, logically breaking up strings of numbers and letters using underscores. A sample module ID can go from 5f6b4cdfabf886024d4de2d3 to 5f_6b_4cdfabf_886024d_4de_2d_3.

Sanitizing improves performance. But it can also lead to unexpected data behavior. If your Create Field is not behaving as expected, try selecting this box. When selected, the operator uses your values and expressions as-is. This is best when working with complex values or values that should remain unchanged.

By default, this setting is selected, which means the operator does not attempt to sanitize.

Preserve Argument Type

When selected, this setting ensures the argument data type is respected when the operator executes.

Condition

Here, you'll set the expression that the operator runs your data against. You'll use <, >, =, >=, or <= to set your expression.

To use another operator as an argument, connect the operator to the argument port. Then, enter _arg here.

Adding an Input Switch Operator

Let’s say you have two Text Field components whose data you’ll use from either of them in your Data Workflow component. You can add a set of Radio Buttons components to let your end-user choose which field passes through your Data Workflow. You'll connect both Text Field components as inputs to the Input Switch operator. Then, you'll connect your Radio Buttons component to the argument port of the operator. You'll configure your Data Workflow to display your end-user's selection in a third Text Field component.

This is a simplified example to demonstrate the functionality of this operator. For a more detailed use case, reference our Input Switch Use Case: Creating a Comment Array article.

Configure the Columns Component

Your Columns component acts as a container for the components that follow.

  1. Drag and drop a Columns component onto your canvas.

  2. In the Property ID field, enter colInputs.

  3. Under Formatting, click   (two columns).

                                               

  4. Click Save Component.

Configure the Text Field Components

Next, let's add input and output fields to your module. You'll use Text Field components to collect your end-user's name and job title. And you'll use a third Text Field component to show the output of your Data Workflow.

  1. Drag and drop three Text Field components onto your canvas, placing them in the left-hand column of the colInputs Columns component.

  2. Enter the following Property ID and Label Text for each component:

    Property ID

    Label Text

    name

    Name

    jobTitle

    Job Title

    output

    Output

  3. Click Save Component as you add and configure them.

Configure the Radio Buttons Component

To let your end-user choose which input they see, you'll add a Radio Buttons component. You'll set this as the argument for your Input Switch in the next step.

  1. Drag and drop a Radio Buttons component onto your canvas, placing it in the right-hand column of the colInputs  Columns component.

  2. In the Property ID field, enter switchArgument.

  3. In the Label Text field, enter Show:.

  4. Set your Label and Value as shown below:

    #

    Label

    Value

    1

    Name

    name

    2

    Job Title

    jobTitle

                                               

  5. Click Save Component.

Configure the Data Workflow Component

Now, you’ll set your Name and JobTitle Text Field components as inputs for your Input Switch operator. Your switchArgument Radio Buttons component serves as the argument. Then, your Input Switch operator outputs the result to your output Text Field component.

  1. Drag and drop a Data Workflow component onto your canvas, placing it below your colInputs Columns component.

  2. In the Canvas Label Text and Property Name fields, enter dwfSwitch.

Configure the First Input Operator

  1. Drag and drop an Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    name

    Required

    No

    Source

    Default

Configure the Second Input Operator

  1. Drag and drop a second Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    jobTitle

    Required

    No

    Source

    Default

Configure the Third Input Operator

  1. Drag and drop a third Input operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input

    Component

    switchArgument

    Required

    Yes

    Source

    Default

Configure the Input Switch Operator

  1. Drag and drop an Input Switch operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Input Switch

    Label

    _arg='name'

    Do Not Sanitize Formula

    Yes (checked)

    Preserve Argument Type

    Unchecked (no)

    Condition

    _arg='name'

  3. Connect the output port (right) of the name Input operator to the upper input port (left) of the _arg='name' Input Switch operator.

  4. Connect the output port (right) of the jonTitle Input operator to the lower input port (left) of the _arg='name' Input Switch operator.

  5. Connect the output port (right) of the switcgArgument Input operator to the argument port (top) of the _arg='name' Input Switch operator.

Configure the Output Operator

  1. Drag and drop an Output operator onto your Data Workflow canvas.

  2. Configure the operator's Info window as follows:

    Setting

    Value

    Category

    Output

    Component

    output

    Action

    value

  3. Connect the output port (right) of the _arg='name' Input Switch operator to the input port (left) of the output Output operator.

  4. Click Save Component.

Configure the Initializer Component

You'll notice this Initializer component performs two operations. First, it clears your output Text Field component so it's ready for a new value each time your Data Workflow runs. Second, it starts the dwfSwitch Data Workflow. You'll add a Button component to trigger your Initializer in the next step.

  1. Drag and drop an Initializer component onto your canvas, placing it above your dwfSwitch Data Workflow component.

  2. In the Property ID and Canvas Label Text fields, enter initSwitch.

  3. Set the Trigger Type as Manual.

  4. In the Outputs table, enter the following:

    #

    Property ID

    Type

    Value

    1

    output

    clear

    yes

    2

    dwfSwitch

    trigger

    GO

  5. Click Save Component.

Configure the Button Component

Lastly, let's add a Button component to begin the operation. When your end-user clicks this button, it triggers your initSwitch Initializer component, which clears your output Text Field component and begins the dwfSwitch Data Workflow.

  1. Drag and drop a Button component onto your canvas, placing it between your jobTitle and output Text Field components.

  2. In the Property ID field, enter btnSwitch.

  3. In the Label Text field, enter Start Input Switch.

  4. Under the Action Type, select Event.

  5. In the On Click field, enter initSwitch.

    This ties your Button component to the Initializer component you'll add in the next step. What you enter here must match the Property ID you assign to that Initializer.

  6. Click Save Component.

  7. Save your module.

Here's how the completed example looks in the Module Builder:

Here's how the completed examples looks in Express View:

Now it's time to test your Data Workflow. Preview your module in Express View and enter a name and job title. Then, make a selection from your radio buttons and click the button. You'll see the selected value in your Output field.