How to: Block Missing Data Using a Gate Operator

Prev Next

The Gate operator blocks the progress of data in a Data Workflow unless it meets your criteria. If the data does not match, it stops the progress. For example, if you have a data set with company account names and values, you can use the Gate operator to display only the value for the name the end-user selects. Any values that do not exist in the data set are blocked, which prevents a circular reference error.

For more information on troubleshooting circular reference errors, view to Troubleshooting: Circular Reference Errors in Data Workflow article.

Configuration

In this how-to guide, you’ll create a Data Workflow that uses Filter and Gate operators to block values that are missing or are less than one. Then, it’ll display the account value that meets your criteria.

Configure the Data Table Component

First, you'll set up a Data Table component with sample data you’ll bring into your Data Workflow.

  1. In the Module Builder, drag and drop a Data Table component onto your canvas.

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

  3. In the data table, enter the following:

    accountName

    accountValue

    Unqork

    100000

    Johnson & Johnson

    400000

    A static image displaying the dtCompanies Data Table component in UDesigner.

  4. Click Save Component.

Configure the Radio Buttons Component

Next, you'll add a Radio Buttons component so the end-user can select an option to pass to the Data Workflow component.

  1. Drag and drop the Radio Buttons component onto your canvas, placing it below the dtCompanies Data Table component.

  2. In the Property ID field, type filter.

  3. In the Label Text field, enter Filter by Company.

  4. Set your Label and Value as shown below:

    Option Label

    Value to Store in Submission Data

    Unqork

    Unqork

    Johnson & Johnson

    Johnson & Johnson

    Other

    Other

    A static image displaying the configuration of the filter Radio Buttons component in UDesigner.

  5. Click Save Component.

Configure the Button Component

Next, add a Button component to trigger an Initializer component you’ll set up in a later step.

  1. Drag and drop a Button component onto your canvas, placing it below the Filter by Company Radio Buttons component.

  2. In the Property ID field, enter btnGetAccountValue.

  3. In the Label Text field, enter Get Account Value.

  4. Set the Action Type as Event.

  5. From the On Click drop-down, select initOnClick.

  6. Navigate to the component’s Advanced settings.

  7. Set Disable on Invalid Forms to files (ON).

    A static image displaying the configuration of the btnGetAccountValue Button component in UDesigner.

  8. Click Save Component.

Configure the Number Component

Now, you'll display the account value associated with its account name. You'll add a Number component to display unblocked data.

  1. Drag and drop a Number component onto your canvas, placing it below the btnGetAccountValue Button component.

  2. In the Property ID field, enter accountValue.

  3. In the Label Text field, enter Account Value.

  4. Set Show Thousands Separator to files (ON).

  5. Click Save Component.A static image displaying the configuration of the accountValue Number component in the UDesigner.

Configure the Initializer Component

Then you'll want to add an Initializer component to run the application every time the end-user clicks the button. That way, the application returns different results without refreshing the page.

  1. Drag and drop an Initializer component onto your canvas, placing it below the btnGetAccountValue Button component.

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

  3. In the Outputs table, enter the following:

    Property ID

    Type

    Value

    accountValue

    clear

    yes

    dwfFilterWithGate

    trigger

    GO

    A static image displaying the configuration of the initOnClick Initializer component in UDesigner.

  4. Click Save Component.

Configure the Data Workflow Component

Next, you'll add a Data Workflow component to retrieve data from the dtCompanies Data Table component and filter it through your Filter and Gate operators. The results will display in the accountValue Number component.

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

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

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

    filter

    Required

    Yes

    Source

    Default

Configure the Second Input Operator

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

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

    Setting

    Value

    Category

    Input

    Component

    dtCompanies

    Required

    Yes

    Source

    Default

Configure the Filter Operator

Next, you'll add a Filter operator so that when the input matches the Filter operator's expression, it passes through the true output port. For this example, the input is the data from the dtCompanies Data Table component and the expression is the end-user's Radio Buttons component selection.

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

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

    Setting

    Value

    Category

    Filter

    Label

    Account Name

    Do Not Sanitize Formula

    (checked)

    Expression

    accountName = _arg

  3. Connect the output port (right) of the filter Input operator to the argument port (top) of the Account Name Filter operator.

  4. Connect the output port (right) of the dtCompanies Input operator to the input port (left) of the Account Name Filter operator.

Configure the First Console Operator

This Console operator displays the Data Workflow's progress after your data passes through the Account Name Filter 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

    Filter True

  3. Connect the upper output port (right) of the Account Name Filter operator to the input port (left) of the Filter True Console operator.

Configure the Second Console Operator

This Console operator lets you determine if your data returns false as it passes through the Account Name Filter 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

    Filter False

  3. Connect the lower output port (right) of the Account Name Filter operator to the input port (left) of the Filter False Console operator.

Configure the Size Operator

You’ll use a Size operator to convert your data into a number value. The dtCompanies Data Table component stores your data as an array. A Size operator measures the length of an array and assigns it a number value. For this module, the data stores one data set, so the size is 1. If the data does not exist, the operator returns a 0. You’ll use the Size number value as the argument for the Gate operator you’ll add later.

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

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

    Setting

    Value

    Category

    Size

    Label

    Convert Number Value

  3. Connect the upper output port (right) of the Account Name Filter operator to the input port (left) of the Convert Number Value Size operator.

Configure the Gate Operator

Next, you'll add a Gate operator to block all values that are 0 or that do not exist.

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

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

    Setting

    Value

    Category

    Gate

    Label

    _arg > 0

    Do Not Sanitize Formula

    (checked)

    Condition

    _arg > 0

  3. Connect the upper output port (right) of the Account Name Filter operator to the input port (left) of the _arg > 0 Gate operator.

  4. Connect the output port (right) of the Size of Result Size operator to the argument port (top) of the _arg > 0 Gate operator.

Configure the Third Console Operator

Then, you'll add another Console operator to view your data's progress after passing through the Gate 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

    Gate Output

  3. Connect the output port (right) of the _arg > 0 Gate operator to the input port (left) of the Gate Output Console operator.

Configure the Get Operator

At this point, your data consists of the account name and value. You only want to output the account value for the end-user to view. You'll use the Get operator to separate the account value from the data and then pass it to the output.

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

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

    Setting

    Value

    Category

    Get

    Label

    accountValue

    Path

    [0].accountValue

  3. Connect the output port (right) of the _arg > 0 Gate operator to the input port (left) of the accountValue Get operator.

Configure the Fourth Console Operator

You'll add one more Console operator to view your data's progress after passing through the Get 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

    Get [0] accountValue

  3. Connect the lower output port (right) of the accountValue Get operator to the input port (left) of the Get [0] accountValue Console 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

    accountValue

    Action

    value

  3. Connect the output port (right) of the accountValue Get operator to the input port (left) of the accountValue Output operator.

    A static image displaying the configuration of the dwfFilterWithGate Data Workflow component in UDesigner.

  4. Click Save Component.

  5. Save the module.

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

A static image displaying the configuration of the module in UDesigner.

Preview the module in Express View and open the DevTools Console. Begin by selecting the Unqork radio button. Then, click the Get Account Value button to see the account value display in the Account Value field.

A static image displaying the Express View and DevTools Console output for Unqork selection.

Now, try using the criteria that do not exist in the data set. Select the Other radio button and click the Get Account Value button. Now, you'll see that no value displays in the Account Value field.

A static image displaying the Express View and DevTools Console output for Other selection.

The Gate operator blocks the progress of data in a Data Workflow unless it meets your criteria. If the data does not match, it stops the progress. For example, if you have a data set with company account names and values, you can use the Gate operator to display only the value for the name the end-user selects. Any values that do not exist in the data set are blocked, which prevents a circular reference error.

For more information on troubleshooting circular reference errors, view to Troubleshooting: Circular Reference Errors in Data Workflow article.

Configuration

In this how-to guide, you’ll create a Data Workflow that uses Filter and Gate operators to block values that are missing or are less than one. Then, it’ll display the account value that meets your criteria.

Configure the Data Table Component

First, you'll set up a Data Table component with sample data you’ll bring into your Data Workflow.

  1. In the Module Builder, drag and drop a Data Table component onto your canvas.

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

  3. In the data table, enter the following:

    accountName

    accountValue

    Unqork

    100000

    Johnson & Johnson

    400000

    A static image displaying the configuration of the dtCompanies Data Table component in Classic Designer.

  4. Click Save & Close.

Configure the Radio Buttons Component

Next, you'll add a Radio Buttons component so the end-user can select an option to pass to the Data Workflow component.

  1. Drag and drop the Radio Buttons component onto your canvas,placing it below the dtCompanies Data Table component.

  2. In the Property ID field, type filter.

  3. In the Label Text field, enter Filter by Company.

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

    Option Label

    Value to Store in Submission Data

    Unqork

    Unqork

    Johnson & Johnson

    Johnson & Johnson

    Other

    Other

    A static image displaying the configuration of the filter Radio Button component in Classic Designer.

  5. Click Save & Close.

Configure the Button Component

Next, add a Button component to trigger an Initializer component you’ll set up in a later step.

  1. Drag and drop a Button component onto your canvas, placing it below the Filter by Company Radio Buttons component.

  2. In the Property ID field, enter btnGetAccountValue.

  3. In the Label Text field, enter Get Account Value.

  4. Select Event as the Action Type.

  5. In the Trigger on Click field, type initOnClick.

  6. Set the Disable on Invalid Forms toggle to files (ON).

    A static image displaying the configuration of the btnGetAccountValue Button component in the Classic Designer.

  7. Click Save & Close.

Configure the Number Component

Now, you'll display the account value associated with its account name. You'll add a Number component to display unblocked data.

  1. Drag and drop a Number component onto your canvas. Place it below the btnGetAccountValue Button component.

  2. In the Property ID field, enter accountValue.

  3. In the Label Text field, enter Account Value.

  4. Set Show Thousands Separator to files (ON).

    A static image displaying the configuration of the accountValue Number component in Classic Designer.

  5. Click Save & Close.

Configure the Initializer Component

Then you'll want to add an Initializer component to run the application every time the end-user clicks the button. That way, the application returns different results without refreshing the page.

  1. Drag and drop an Initializer component onto your canvas, placing it below the btnGetAccountValue Button component.

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

  3. In the Outputs table, enter the following:

    Property ID

    Type

    Value

    accountValue

    clear

    yes

    dwfFilterWithGate

    trigger

    GO

    A static image displaying the configuration fo the intiOnClick Initializer component in Classic Designer.

  4. Click Save & Close.

Configure the Data Workflow Component

Next, you'll add a Data Workflow component to retrieve data from the dtCompanies Data Table component and filter it through your Filter and Gate operators. The results will display in the accountValue Number component.

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

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

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

    filter

    Required

    Yes

    Source

    Default

Configure the Second Input Operator

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

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

    Setting

    Value

    Category

    Input

    Component

    dtCompanies

    Required

    Yes

    Source

    Default

Configure the Filter Operator

Next, you'll add a Filter operator so that when the input matches the Filter operator's expression, it passes through the true output port. For this example, the input is the data from the dtCompanies Data Table component and the expression is the end-user's Radio Buttons component selection.

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

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

    Setting

    Value

    Category

    Filter

    Label

    Account Name

    Do Not Sanitize Formula

    (checked)

    Expression

    accountName = _arg

  3. Connect the output port (right) of the filter Input operator to the argument port (top) of the Account Name Filter operator.

  4. Connect the output port (right) of the dtCompanies Input operator to the input port (left) of the Account Name Filter operator.

Configure the First Console Operator

This Console operator displays the Data Workflow's progress after your data passes through the Account Name Filter 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

    Filter True

  3. Connect the upper output port (right) of the Account Name Filter operator to the input port (left) of the Filter True Console operator.

Configure the Second Console Operator

This Console operator lets you determine if your data returns false as it passes through the Account Name Filter 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

    Filter False

  3. Connect the lower output port (right) of the Account Name Filter operator to the input port (left) of the Filter False Console operator.

Configure the Size Operator

You’ll use a Size operator to convert your data into a number value. The dtCompanies Data Table component stores your data as an array. A Size operator measures the length of an array and assigns it a number value. For this module, the data stores one data set, so the size is 1. If the data does not exist, the operator returns a 0. You’ll use the Size number value as the argument for the Gate operator you’ll add later.

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

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

    Setting

    Value

    Category

    Size

    Label

    Convert Number Value

  3. Connect the upper output port (right) of the Account Name Filter operator to the input port (left) of the Convert Number Value Size operator.

Configure the Gate Operator

Next, you'll add a Gate operator to block all values that are 0 or that do not exist.

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

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

    Setting

    Value

    Category

    Gate

    Label

    _arg > 0

    Do Not Sanitize Formula

    (checked)

    Condition

    _arg > 0

  3. Connect the upper output port (right) of the Account Name Filter operator to the input port (left) of the _arg > 0 Gate operator.

  4. Connect the output port (right) of the Size of Result Size operator to the argument port (top) of the _arg > 0 Gate operator.

Configure the Third Console Operator

Then, you'll add another Console operator to view your data's progress after passing through the Gate 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

    Gate Output

  3. Connect the output port (right) of the _arg > 0 Gate operator to the input port (left) of the Gate Output Console operator.

Configure the Get Operator

At this point, your data consists of the account name and value. You only want to output the account value for the end-user to view. You'll use the Get operator to separate the account value from the data and then pass it to the output.

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

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

    Setting

    Value

    Category

    Get

    Label

    accountValue

    Path

    [0].accountValue

  3. Connect the output port (right) of the _arg > 0 Gate operator to the input port (left) of the accountValue Get operator.

Configure the Fourth Console Operator

You'll add one more Console operator to view your data's progress after passing through the Get 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

    Get [0] accountValue

  3. Connect the lower output port (right) of the accountValue Get operator to the input port (left) of the Get [0] accountValue Console 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

    accountValue

    Action

    value

  3. Connect the output port (right) of the accountValue Get operator to the input port (left) of the accountValue Output operator.

    A static image displaying the configuration of the dwfFilterWithGate Data Workflow in Classic Designer.

  4. Click Save.

  5. Save the module.

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

A static image displaying the configuration of the Module in the Module Builder of the Classic Designer.

Preview the module in Express View and open the DevTools Console. Begin by selecting the Unqork radio button. Then, click the Get Account Value button to see the account value display in the Account Value field.

A static image displaying the Express View and DevTools Console output for Unqork selection.

Now, try using the criteria that do not exist in the data set. Select the Other radio button and click the Get Account Value button. Now, you'll see that no value displays in the Account Value field.

A static image displaying the Express View and DevTools Console output for Other selection.