How to: Nest by Child Name Using the Nest By Operator

Prev Next

The Nest By operator groups multiple rows of data based on one or more specified fields, creating a nested structure. It’s especially useful when you want to consolidate related records under a common parent—for example, grouping multiple orders under a single customer. This operator outputs a single row per group, with a nested array containing all the grouped records. It’s ideal for preparing data for display in repeating panels or for organizing complex datasets before further processing.

These instructions assume you have a new module open, saved, and with a title.

Configuration

In this how-to guide, you'll create a data table of information and nest all the rows into a single array.

Configure the Data Table Component

First, you'll set up a Data Table component with a list of customers, account values, and account numbers.

  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 dtAccountInfo.

  3. In the data table, enter the following:

    firstName

    lastName

    accountValue

    accountNumber

    Josephine

    Darakjy

    543891

    12345

    Lenna

    Paprocki

    1000000

    12346

    Sage

    Wieser

    1000000

    12346

    Abel

    Maclead

    7432572

    12347

    Ernie

    Stenseth

    5000000

    12348

    Valentine

    Gillian

    5439294

    12349

    Dyan

    Oldroyd

    17890

    12346

    Fatima

    Saylors

    19578

    12347

    Willow

    Kusko

    54389

    12347

    You purposely added duplicate information to show the power of the Nest By operator.

    A static image displaying the configuration of the dtAccountInfo Data Table.

  4. Click Save Component.

Configure the Data Workflow Component

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

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

    A static image displaying the configuration of the dwfNestByChild Data Workflow.

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:

    Setting

    Value

    category

    Input

    Component

    dtAccountInfo

    required

    No

    source

    Default

Configure the Nest By Operator

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

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

    Setting

    Value

    category

    Nest By

    label

    Nest by Child Name

    Parent Keys

    Child Name

    account

  3. Connect the output port (right) of the dtAccountInfo Input operator to the input port (left) of the Nest by Child Name Nest By operator.

Configure the 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

    Child Name Only

  3. Connect the output port (right) of the Nest by Child Name Nest By operator to the input port (left) of the Child Name Only Console operator.

  4. Click Save Component.

Configure the Button Component

Lastly, configure a Button component to trigger your Data Workflow.

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

  2. In the Property ID field, enter btnNestByChild.

  3. In the Label Text field, enter Nest by Child Name.

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

  5. In the On Click field, enter dwfNestByChild.

    A static image displaying the configuration of the btnNestByChild Button component.

  6. Click Save Component.

  7. Save your module.

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

A static image displaying the module configuration for explaining Nest By operator.

Preview your module in Express View and open the DevTools Console. Click the Nest by Child Name button, and you'll see all nine of your table rows nested in a single array with account as the child name.

A static image displaying the Express View and the Dev Console.

The Nest By operator groups multiple rows of data based on one or more specified fields, creating a nested structure. It’s especially useful when you want to consolidate related records under a common parent—for example, grouping multiple orders under a single customer. This operator outputs a single row per group, with a nested array containing all the grouped records. It’s ideal for preparing data for display in repeating panels or for organizing complex datasets before further processing.

These instructions assume you have a new module open, saved, and with a title.

Configuration

In this how-to guide, you'll create a data table of information and nest all the rows into a single array.

Configure the Data Table Component

First, you'll set up a Data Table component with a list of customers, account values, and account numbers.

  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 dtAccountInfo.

  3. In the data table, enter the following:

    firstName

    lastName

    accountValue

    accountNumber

    Josephine

    Darakjy

    543891

    12345

    Lenna

    Paprocki

    1000000

    12346

    Sage

    Wieser

    1000000

    12346

    Abel

    Maclead

    7432572

    12347

    Ernie

    Stenseth

    5000000

    12348

    Valentine

    Gillian

    5439294

    12349

    Dyan

    Oldroyd

    17890

    12346

    Fatima

    Saylors

    19578

    12347

    Willow

    Kusko

    54389

    12347

    You purposely added duplicate information to show the power of the Nest By operator.

    A static image displaying the configuration of the dtAccountInfo Data Table component.

  4. Click Save & Close.

Configure the Data Workflow Component

  1. Drag and drop a Data Workflow component onto your canvas. Place it below the Data Table component.

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

    A static image displaying the configuration of the dwfNestByChild Data Workflow component.

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:

    Setting

    Value

    category

    Input

    Component

    dtAccountInfo

    required

    No

    source

    Default

Configure the Nest By Operator

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

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

    Setting

    Value

    category

    Nest By

    label

    Nest by Child Name

    Parent Keys

    Child Name

    account

  3. Connect the output port (right) of the dtAccountInfo Input operator to the input port (left) of the Nest by Child Name Nest By operator.

Configure the 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

    Child Name Only

  3. Connect the output port (right) of the Nest by Child Name Nest By operator to the input port (left) of the Child Name Only Console operator.

  4. Click Save.

Configure the Button Component

Lastly, configure a Button component to trigger your Data Workflow.

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

  2. In the Property ID field, enter btnNestByChild.

  3. In the Label Text field, enter Nest by Child Name.

  4. Set the Action Type as Event.

  5. In the On Click field, enter dwfNestByChild.

    A static image displaying the configuration of the btnNestByChild Button component.

  6. Click Save & Close.

  7. Save your module.

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

A static image displaying the configuration of the module used to explain the Nest By operator.

Preview your module in Express View and open the DevTools Console. Click the Nest by Child Name button, and you'll see all nine of your table rows nested in a single array with account as the child name.

A static image displaying the Express View and the Dev Console.