How to: Use a Has Operator With the Group Input Operator

Prev Next

Info panel displaying category, label, and path fields for a 'Has' element.The Has operator inputs an object and outputs a true or false Boolean value. The output is dependent on the object's key. If the operator's key matches the object's key, the output is true. If not, the output is false.

In this how-to guide, you’ll set up four Hidden components to input data to your Data Workflow component. Then, you'll group it using a Group Input operator and pass it to a Has operator.

You'll set up the Has operator to look in the Group Input operator for a specific key. If the Has operator locates a match, the output is true. If the operator does not locate a match, the output is false. In this example, you'll configure the Has operator's key to be one of your Hidden components.

Remember, you must spell the key correctly or the output will be false. For example, if your key is value2, entering value gives you a false output.

Configure the Hidden Components

First, you'll set up four Hidden components to store your inputs. For each component, you'll enter a different question in the Default Value field.

  1. In the Module Builder, drag and drop four Hidden components onto your canvas, placing them one after the other.

  2. Enter the following Property ID, Label Text, and Default Value values:

    Property ID

    Canvas Label Text

    Default Value

    value1

    value1

    Who can have the Has?

    value2

    value2

    Or is it, who has the Have?

    value3

    value3

    Does the Get get the Has?

    value4

    value4

    Or, does the Has have the Get?

  3. Click Save Component as you add each component.

Configure the Data Workflow Component

Now, you'll set up your Data Workflow. First, you'll add a Group Input operator so you can input all four Hidden components as objects. Then you'll pass these objects through your Has operator, looking specifically for value2. Because the value2 Hidden component exists, your Data Workflow's output is true. You'll set up a couple of Console operators to watch the progress.

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

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

Configure the Group Input Operator

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

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

    Setting

    Value

    Category

    Group Input

    Component

    value1

    Component 1

    value2

    Component 2

    value3

    Component 3

    value4

    Component 4

    Component 5

    Required

    Yes

Configure the Has Operator

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

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

    Setting

    Value

    Category

    Has

    Label

    Has value2

    Path

    value2

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

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:

    Setting

    Value

    Category

    Console

    Label

    Group Input

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

Configure the Second Console Operator

  1. Drag and drop another Console operator onto your Data Workflow canvas.

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

    Setting

    Value

    Category

    Console

    Label

    Group Input Has value2?

  3. Connect the lower output port (right) of the Has value2 Has operator to the input port (left) of the Group Input Has value2? Console operator.

    Workflow diagram showing data input and console outputs with highlighted elements.

  4. Click Save Component.

Configure the Button Component

Now, add a Button component to trigger your Data Workflow component.

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

  2. In the Property ID field, enter btnHasGroupInput.

  3. In the Label Text field, enter Get the Has.

  4. From the Action Type drop-down, select Event.

  5. In the Trigger on Click field, enter dwfHasGroupInput.

    Button configuration with action type and triggers for user interaction settings.

  6. Click Save Component.

  7. Save your module.

Here's how your module looks in the Module Builder:

Input fields for values and a highlighted section for group input functionality.

Test out your Data Workflow by opening and expanding the DevTools Console. Click the Get the Has button. The first Console displays all four Hidden component values, and the second Console displays the result of the Has operator. You can see the output is true because the value2 object exists in the Group Input operator. To confirm other keys, you'll change your Has operator to look for another hidden value.

Console output showing group input values and a true status message.

Information panel displaying category, label, and path details for the 'Has' element.The Has operator inputs an object and outputs a true or false Boolean value. The output is dependent on the object's key. If the operator's key matches the object's key, the output is true. If not, the output is false.

In this how-to guide, you’ll set up four Hidden components to input data to your Data Workflow component. Then, you'll group it using a Group Input operator and pass it to a Has operator.

You'll set up the Has operator to look in the Group Input operator for a specific key. If the Has operator locates a match, the output is true. If the operator does not locate a match, the output is false. In this example, you'll configure the Has operator's key to be one of your Hidden components.

Remember, you must spell the key correctly or the output will be false. For example, if your key is value2, entering value gives you a false output.

Configure the Hidden Components

First, you'll set up four Hidden components to store your inputs. For each component, you'll enter a different question in the Default Value field.

  1. In the Module Builder, drag and drop four Hidden components onto your canvas, placing them one after the other.

  2. Enter the following Property ID, Canvas Label Text, and Default Value values:

    Property ID

    Canvas Label Text

    Default Value

    value1

    value1

    Who can have the Has?

    value2

    value2

    Or is it, who has the Have?

    value3

    value3

    Does the Get get the Has?

    value4

    value4

    Or, does the Has have the Get?

  3. Save & Close each component as you add it.

Configure the Data Workflow Component

Now, you'll set up your Data Workflow. First, you'll add a Group Input operator so you can input all four Hidden components as objects. Then you'll pass these objects through your Has operator, looking specifically for value2. Because the value2 Hidden component exists, your Data Workflow's output is true. You'll set up a couple of Console operators to watch the progress.

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

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

Configure the Group Input Operator

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

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

    Setting

    Value

    Category

    Group Input

    Component

    value1

    Component 1

    value2

    Component 2

    value3

    Component 3

    value4

    Component 4

    Component 5

    Required

    Yes

Configure the Has Operator

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

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

    Setting

    Value

    Category

    Has

    Label

    Has value2

    Path

    value2

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

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:

    Setting

    Value

    Category

    Console

    Label

    Group Input

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

Configure the Second Console Operator

  1. Drag and drop another Console operator onto your Data Workflow canvas.

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

    Setting

    Value

    Category

    Console

    Label

    Group Input Has value2?

  3. Connect the lower output port (right) of the Has value2 Has operator to the input port (left) of the Group Input Has value2? Console operator.

    Data workflow interface showing group input and console components with options.

  4. Click Save.

Configure the Button Component

Now, add a Button component to trigger your Data Workflow component.

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

  2. In the Property ID field, enter btnHasGroupInput.

  3. In the Label field, enter Get the Has.

  4. Under Action Type, select Event.

  5. In the Trigger on Click field, enter dwfHasGroupInput.

    Button settings for saving, validating, and triggering events in a workflow module.

  6. Click Save & Close.

  7. Save your module.

Here's how your module looks in the Module Builder:

Module editor interface displaying components and input fields for configuration.

Test out your Data Workflow by opening and expanding the DevTools Console. Click the Get the Has button. The first Console displays all four Hidden component values, and the second Console displays the result of the Has operator. You can see the output is true because the value2 object exists in the Group Input operator. To confirm other keys, you'll change your Has operator to look for another hidden value.

Console output showing group input values and a true status message.