Decision Operator

A static image displaying the Data Workflow component's Decision Operator icon and configuration window.

The Decision operator lets you build simple logic statements that evaluate whether input values meet specific conditions. Based on the result, the operator outputs true or false, letting you control the flow in a  Data Workflow.

To configure a Decision operator, use the Info window and define a condition. This condition uses comparison symbols, like <, >, =, >=, or <=, to evaluate incoming data. For example, to check if an end-user's income is greater than 100,000, your condition might look like the following: A > 100000. Here, A represents the incoming value, and 100000 is the threshold.

For more advanced logic, you can use an OR statement. For example, OR(A="a", A="b", A="c"). This configuration returns true if the input value matches "a", "b", or "c". All other values return false.

The Decision operator evaluates conditions and routes data based on the result. It passes data through one output port at a time. The port that does not receive data displays as _BLOCKED, and any steps connected to that port will not execute.

Using Arguments in Conditions

You can configure a Decision operator to evaluate a condition using an argument from another operator.

For example, you'll:

  • Connect another operator to the argument port (top) of the Decision operator.

  • Enter _arg in the Condition field.

The argument must return a string or Boolean value. Your condition should use a standard comparison format, like <, >, =, >=, or <=. The condition must be either TRUE or FALSE.

You'll find the Decisions operator under the Gateways group to the left of the Data Workflow canvas.

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

Setting

Description

Category

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

Input List

Select the Property ID for the data you want your Decision operator to process. This selection should match the Property ID you've selected in your Input operator.

This field is optional, but making a selection displays a label below your operator. These labels can help to keep your canvas organized.

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 the operator runs your data against. You'll use <, >, =, >=, or <= to set your expression. You can also use a combination of these, set inside an OR statement. For example, OR(A="a",A="b",A="c").

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

To see how the Decision operator works, you’ll walk through a simple example. In this example, you’ll create a module that collects an end-user’s income. Then, you’ll use a Data Workflow to recommend a financial adviser to the end-user based on the income entered.

Configure the Columns Component

First configure a Columns component that acts as containers for the components that follow.

1. In the Module Builder, drag and drop a Columns Component Icon Columns component onto your canvas.
2. In the Property ID  field, enter colAdviser.
3. Click Save Component

Configure the Number Component

Next, configure a Number component to collect the income of your end-user.

1. Drag and drop a Number component onto your canvas, placing it inside the left column of the colAdviser Columns Component Icon Columns component.
2. In the Property ID field, enter income.
3. In the Label Text field, enter Current Household Income.
4. Set Show Thousands Separator to  (ON).
5. Set Currency to  (ON).

Static image showing the Number component configuration window, with the Currency and Show Thousands separator toggles set to ON.

6. Click Save Component.

Configure the Text Field Component

Next, add a Text Field component to display the output of your Data Workflow. This field displays the recommended financial adviser to the end-user. Because the end-user does not need to enter any information to this field, set it to read-only.

1. Drag and drop a  Text Field component onto your canvas, placing it inside the right column of the colAdviser Columns Component Icon Columns component.
2. In the Property ID field, enter financialAdviser.
3. In the Label Text field, enter Recommended Financial Adviser.
4. From the Input Behavior drop-down, select Read Only - Accessible (New).

A Static image displaying the Text Field component configuration window set to Read Only.

5. Click Save Component.

Configure the Data Workflow Component

Lastly, set up the Data Workflow with an Input operator that brings in your end-user's income. Then, use a Decision operator to determine which financial adviser to recommend. Add Console operators to help you view how the data passes to each step.

1. Drag and drop a Data Workflow onto your canvas, placing it below your colAdviserColumns Component Icon Columns component.
2. In the Property ID and Canvas Label Text fields, enter dwfFinancialAdviser.
3. From the Trigger Type drop-down, select Watch.

Configure the Input Operator

1. Drag and drop an Input operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Input

Component

income

Required

Yes

Source

Default

Configure the Decision Operator

1. Drag and drop a Decision operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Decision

Input List

income

Preserve Argument Type

Unchecked (no)

Condition

A > 100000

3. Connect the output port (right) of the Input operator to the input port (left) of the Decision operator.

Configure the First Create Value Operator

1. Drag and drop a Create Value operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Create Value

Label

Decision True

Expression/Value

"Andrea Matthews"

3. Connect the upper output port (right) of the Decision operator to the argument port (top) of the Create Value operator.

Configure the First Output Operator

1. Drag and drop an Output operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Output

Component

financialAdviser

Action

value

3. Connect the output port (right) of the Create Value operator to the input port (left) of the Outputoperator.

Configure the First Console Operator

1. Drag and drop a Console operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Console

Label

Console Decision True

3. Connect the upper output port (right) of the Decision operator to the input port (left) of the Console operator.

Configure the Second Create Value Operator

1. Drag and drop a second Create Value operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Create Value

Label

Decision False

Expression/Value

"Rachel Moose"

3. Connect the lower output port (right) of the Decision operator to the argument port (top) of the Decision False Create Value operator.

Configure the Second Output Operator

1. Drag and drop a second Output operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Output

Component

financialAdviser

Action

value

3. Connect the output port (right) of the Decision False Create Value operator to the input port (left) of the financialAdviser Output operator.

Configure the Second Console Operator

1. Drag and drop a second Console operator onto your Data Workflow canvas.
2. Configure the operator's Info window as follows:

Info

Category

Console

Label

Console Decision False

3. Connect the lower output port (right) of the Decision operator to the input port (left) of the Console Decision False Console operator.
4. Click Save Component.
5.  Save  your module.

Here's how the completed Data Workflow looks:

A static image displaying the Data Workflow configuration with the trigger type set to Watch.

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

A static image displaying the Decision operator completed use case in the Module Builder.

Preview your module in Express View and open the DevTools Console.

If you open your browser’s DevTools Console, you’ll see how the logic works. Enter a value in your Current Household Income field and you'll see the Recommended Financial Adviser update in real-time, depending on your entered income.

You'll see one of two scenarios:

  • When the income is less than 100,000, the TRUE condition is _BLOCKED, and the FALSE condition displays the value.

  • When the income is greater than 100,000, the FALSE condition is _BLOCKED, and the TRUE condition displays the value.