--- title: "Nest By Operator" slug: "nest-by-operator" description: "Learn how to use the Nest By operator to group rows in a data table by a shared parent key, enhancing data organization and efficiency." updated: 2025-10-28T13:29:47Z published: 2025-10-28T13:29:47Z canonical: "docs.unqork.io/nest-by-operator" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.unqork.io/llms.txt > Use this file to discover all available pages before exploring further. # Nest By Operator UDesignerClassic Designer ![A static image displaying the Nest By operator along with its Info window in the Data Workflow canvas.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Nest By UDesigner.png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) The **Nest By** **operator** creates a nested table (array of objects) in a connected parent table. Nesting arrays allows you to group rows by a shared parent key. Rows with the same parent key value are combined, and the remaining fields are nested under a specified child name key. You'll configure the operator with a parent key that'll remain un-nested for each row. Then, you’ll provide a child name key where your new nested array will exist. This configuration lets you group rows of data by a parent key value. For example, you can nest by a parent key that has the same value across multiple rows. All rows with the same parent key value group into one row. The remaining fields nest as individual rows in the same child name array. > [!NOTE] > Keys that are not consistent across all arrays will be dropped, which can result in data loss. You'll find the Nest By operator under the [Table Operators](https://docs.unqork.io/docs/tableoperators) group to the left of the [Data Workflow](https://docs.unqork.io/docs/data-workflow-component) canvas. ## About the Info Window Here's a breakdown of each setting in the Nest By 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. | | Preserve Argument Type | When selected, this setting ensures the argument data type is respected when the operator executes. | | Parent Keys | The Parent Key is how you'll group your information. The nested array will contain as many rows as keys share the Parent Key value. All rows with the same Parent Key value will group into one row. All values except the Parent Key will nest as an array under the Child Name you configure for the operator. You can also provide more than one Parent Key. This means that rows must match both keys to become nested. | | Child Name | This is the key name of the nested array that you're creating. You'll see this Child Name carried through into the DevTools Console. Without a Child Name, it's difficult to find your nested array in the DevTools Console. | ## Adding a Nest By Operator In this example, you'll use the Nest By operator to group by the duplicate account numbers in your [Data Table](https://docs.unqork.io/docs/data-table-component) component. That way, you can set the table's account number as the operator's key. > [!NOTE] > These instructions assume you have a module open, saved, and titled. ### 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** field, enter `dtAccountInfo.` 3. In the data table, enter the following: | # | accountNumber | firstName | lastName | accountValue | | --- | --- | --- | --- | --- | | 1 | 12345 | Josephine | Darakjy | 543891 | | 2 | 12346 | Lenna | Paprocki | 1000000 | | 3 | 12346 | Sage | Wieser | 1000000 | | 4 | 12347 | Abel | Maclead | 7432572 | | 5 | 12348 | Ernie | Stenseth | 5000000 | | 6 | 12349 | Valentine | Gillian | 5439294 | | 7 | 12346 | Dyan | Oldroyd | 17890 | | 8 | 12347 | Fatima | Saylors | 19578 | | 9 | 12347 | Willow | Kusko | 54389 | > [!NOTE] > You purposely added duplicate information to show the power of the Nest By operator. ![A static image displaying the Data Table containing accountNumber, firstName, lastName, and accountValue columns.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(122).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) 4. Click on **Save Component**. ### Configure the Button Component To trigger the Data Workflow, you'll add a [Button](/v1/docs/button-component) component. 1. Drag and drop a [Button](https://docs.unqork.io/docs/button-component) component onto your canvas, placing it below your `dtAccountInfo` **Data Workflow** component. 2. In the **Property ID**, enter `btnNestByNumber`. 3. In the **Label Text** field, enter `Nest by Account Number`. 4. From the **Action Type** drop-down, select **Event**. 5. In the **Triggers On Click** field, enter `dwfNestByNumber`. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(135).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) 6. Click **Save Component**. ### Configure the Data Workflow Component Now, you'll set up your Data Workflow to input and nest the data from your Data Table component. 1. Drag and drop a [Data Workflow](https://docs.unqork.io/docs/data-workflow-component) component onto your canvas, placing it below your `btnNestByNumber` **Button** component. 2. In the **Property ID** and **Canvas Label Text** fields, enter `dwfNestByNumber`. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(138).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) #### 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 accountNumber | | Parent Keys | accountNumber | | Child Name | account | 3. Connect the output port (right) of the `dtAccountInfo` **Input** operator to the input port (left) of the `Nest by accountNumber` **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 | Nest by Account Number | 3. Connect the output port (right) of the `Nest by accountNumber` **Nest By** operator to the input port (left) of the `Nest by accountNumber` **Console** operator. 4. Click on **Save Component**. 5. **Save** your module. Here's how the completed example looks in the Module Builder: ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(133).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) Preview your module in Express View, and open the DevTools Console. Click the **Nest By Account Number** button, and you'll see the nine table rows grouped into five rows. Each new array now has the child name of the account. You can also see that these new arrays are nested by `accountNumber`. ![A static image displaying the module in Express view and the data in DevTools Console.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/DWF_Nest_By_07.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) ![A static image displaying the Nest By operator with its Info window in the Data Workflow canvas.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Nest By Classic Designer.png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D)The **Nest By** **operator** creates a nested table (array of objects) in a connected parent table. Nesting arrays allows you to group rows by a shared parent key. Rows with the same parent key value are combined, and the remaining fields are nested under a specified child name key. You'll configure the operator with a parent key that'll remain un-nested for each row. Then, you’ll provide a child name key where your new nested array will exist. This configuration lets you group rows of data by a parent key value. For example, you can nest by a parent key that has the same value across multiple rows. All rows with the same parent key value group into one row. The remaining fields nest as individual rows in the same child name array. > [!NOTE] > Keys that are not consistent across all arrays will be dropped, which can result in data loss. You'll find the Nest By operator under the [Table Operators](https://docs.unqork.io/docs/tableoperators) group to the left of the [Data Workflow](https://docs.unqork.io/docs/data-workflow-component) canvas. ## About the Info Window Here's a breakdown of each setting in the Nest By 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. | | Preserve Argument Type | When selected, this setting ensures the argument data type is respected when the operator executes. | | Parent Keys | The Parent Key is how you'll group your information. The nested array will contain as many rows as keys share the Parent Key value. All rows with the same Parent Key value will group into one row. All values except the Parent Key will nest as an array under the Child Name you configure for the operator. You can also provide more than one Parent Key. This means that rows must match both keys to become nested. | | Child Name | This is the key name of the nested array that you're creating. You'll see this Child Name carried through into the DevTools Console. Without a Child Name, it's difficult to find your nested array in the DevTools Console. | ## Adding a Nest By Operator In this example, you'll use the Nest By operator to group by the duplicate account numbers in your [Data Table](https://docs.unqork.io/docs/data-table-component) component. That way, you can set the table's account number as the operator's key. > [!NOTE] > These instructions assume you have a module open, saved, and titled. ### Configure the Data Table Component First, you'll set up a Data Table 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 **Label** and **Property Name** fields, enter `dtAccountInfo.` 3. In the **Data Table**, enter the following: | # | accountNumber | firstName | lastName | accountValue | | --- | --- | --- | --- | --- | | 1 | 12345 | Josephine | Darakjy | 543891 | | 2 | 12346 | Lenna | Paprocki | 1000000 | | 3 | 12346 | Sage | Wieser | 1000000 | | 4 | 12347 | Abel | Maclead | 7432572 | | 5 | 12348 | Ernie | Stenseth | 5000000 | | 6 | 12349 | Valentine | Gillian | 5439294 | | 7 | 12346 | Dyan | Oldroyd | 17890 | | 8 | 12347 | Fatima | Saylors | 19578 | | 9 | 12347 | Willow | Kusko | 54389 | > [!NOTE] > You purposely added duplicate information to show the power of the Nest By operator. ![A static image displaying the Data Table containing accountNumber, firstName, lastName, and accountValue columns.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/DWF_Nest_By_04(2).jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) 4. Click **Save**. ### Configure the Button Component To trigger the Data Workflow, you'll add a [Button](/v1/docs/button-component) component. 1. Drag and drop a [Button](https://docs.unqork.io/docs/button-component?highlight=button) component onto your canvas. Place your Button component below the `dtAccountInfo` **Data Table** component. 2. In the **Property ID**, enter `btnNestByNumber`. 3. In the **Label Text field**, enter `Nest by Account Number`. 4. Set the **Action Type** as **Event**. 5. In the **Triggers On Click** field, enter `dwfNestByNumber`. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(136).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) 6. Click **Save**. ### Configure the Data Workflow Component Now, you'll set up your Data Workflow to input and nest the data from your Data Table component. 1. Drag and drop a [Data Workflow](https://docs.unqork.io/docs/data-workflow-component?highlight=data%20workflow) component onto your canvas, placing it below your `dtAccountInfo` **Data Table** component. 2. In the **Canvas Label Text** and **Property Name** fields, enter `dwfNestByNumber`. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(139).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) #### 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 accountNumber | | Parent Keys | accountNumber | | Child Name | account | 3. Connect the output port (right) of the `dtAccountInfo` **Input** operator to the input port (left) of the `Nest by accountNumber` **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 | Nest by Account Number | 3. Connect the output port (right) of the `Nest by accountNumber` **Nest By** operator to the input port (left) of the `Nest by accountNumber` **Console** operator. 4. Click **Save**. 5. **Save** your module. Here's how the completed use case will look in the Module Builder: ![A static image displaying the Module Builder of the final configuration.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(112).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) Preview your module in Express View, and open the DevTools Console. Click the **Nest By Account Number** button, and you'll see the nine table rows grouped into five rows. Each new array now has the child name of the account. You can also see that these new arrays are nested by `accountNumber`. ![A static image displaying the module in Express view and the data in DevTools Console.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/DWF_Nest_By_07.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A48Z&se=2026-11-07T18%3A57%3A48Z&sr=c&sp=r&sig=EYtRgEXGO%2BhnV%2BZXTWpiFGDqYTuFXS%2FP0V%2BY6kFVlHg%3D) An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects. An object is a type of data structure that represents a single, self-contained entity that acts as a container for the characteristics of that entity. The DevTools Console helps you securely store, build, test, and deploy your software. Express View is how your end-user views your application. Express View also lets you preview your applications to test your configuration and view the styling. This is also the view your end-users will see when interacting with your application. After configuring a module, click Preview in the Module Builder to interact with the module in Express View. The DevTools Console helps you securely store, build, test, and deploy your software. ## Related - [Data Workflow Component](/data-workflow-component.md) - [Introduction to Data Workflow](/introduction-to-data-workflow.md)