--- title: "How to: Create a Comment Array Using the Input Switch Operator" slug: "input-switch-operator-creating-a-comment-array" updated: 2025-12-23T15:16:58Z published: 2025-12-23T15:16:58Z canonical: "docs.unqork.io/input-switch-operator-creating-a-comment-array" --- > ## 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. # How to: Create a Comment Array Using the Input Switch Operator UDesignerClassic Designer The **Switch** **operator** lets you configure a single [Data Workflow](/v1/docs/data-workflow-component) with two inputs. The operator determines which input to use based on a condition. ## Configuration In this how-to guide, you’ll use the Input Switch operator to create an array of received comments in your application. Doing so requires a [Create Table](https://docs.unqork.io/docs/create-table-operator) operator and an [Input](https://docs.unqork.io/docs/input-operator) operator to add new comments to those already received. To switch between these inputs, you'll add an [Input Switch](https://docs.unqork.io/docs/input-switch-operator) operator. ### Configure the Text Area Component Begin by adding a [Text Area](https://docs.unqork.io/docs/text-area-component) component where end-users can enter comments. 1. In the Module Builder, drag and drop a **Text Area** component onto your canvas. 2. In the **Property ID** field, enter `comment`. 3. In the **Label Text** field, enter `Comment`. 4. Click **Save Component**. ### Configure the Initializer Component Next, configure an [Initializer](https://docs.unqork.io/docs/initializer-component) component to clear your Text Area component after each comment. You’ll trigger this Initializer component using a [Data Workflow](/v1/docs/data-workflow-component) you’ll configure in later steps. 1. Drag and drop an **Initializer** component onto your canvas, placing it above your `comment` Text Area component. 2. In the **Property ID** and **Canvas Label Text** fields, enter `initClear`. 3. In the **Outputs** table, enter the following: | # | Source | Type | Value | | --- | --- | --- | --- | | 1 | comment | clear | yes | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/UD_InputSwitch_Initializer(1).jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) 4. Click **Save Component**. ### Configure the Hidden Component Next, configure a [Hidden](https://docs.unqork.io/docs/hidden-component) component to store the output of your Data Workflow. 1. Drag and drop a **Hidden** component onto your canvas, placing it below your `comment` **Text Area** component. 2. In the **Property ID** and **Label Text** fields, enter `commentsTable`. 3. Click **Save Component**. ### Configure the Data Workflow Component Now configure your [Data Workflow](https://docs.unqork.io/docs/using-unqorks-dataworkflow). In this example, you'll use many operators to collect your end-user's information and append it. The [Input Switch](/v1/docs/input-switch-operator) operator plays a crucial role in this configuration. You'll connect a [Create Table](/v1/docs/create-table-operator) operator to fire when you receive your first comment. Later, you'll connect an [Input](/v1/docs/input-operator) operator to reference your `commentsTable` **Hidden** component. Then, you'll use a [Size](/v1/docs/size-operator) operator to determine if your [Hidden](/v1/docs/hidden-component) component stores any comments or if it's empty. This Size operator serves as the argument for your Input Switch operator. So, if your Hidden component has a size greater than `0`, the Input Switch chooses that as the input. Doing so lets you keep all your comments in one place. If your Hidden component is empty, the Input Switch chooses your Create Table operator instead. Your Input Switch uses your Create Table operator only for the first comment. For every comment that follows, the Input Switch chooses your Hidden component. 1. Drag and drop a **Data Workflow** component onto your canvas, placing it between your `comment` **Text Area** and `commentsTable` **Hidden** components. 2. In the **Property ID** and **Canvas Label Text** fields, enter `dwfAddComment`. #### 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 | comment | | Required | No | | Source | Default | #### Configure the First Create Table Operator 1. Drag and drop a **Create Table** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Create Table | | Label | New Comment | | Create Index | No | | Number of Rows | 1 | #### Configure the First Create Field Operator 1. Drag and drop a **Create Field** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Formula | | Label | Add Comment | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Preserve Argument Type | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Field 1 | comment=_arg | | Field 2 | | | Field 3 | | | Field 4 | | | Field 5 | | 3. Connect the output port (right) of the `comment` **Input** operator to the argument port (top) of the `Add Comment` **Create Field** operator. 4. Connect the output port (right) of the `New Comment` **Create Table** operator to the input port (left) of the `Add Comment` **Create Field** operator. #### Configure the Second Input Operator 1. Drag and drop a second **Input** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Input | | Component | currentUser | | Required | No | | Source | Default | #### Configure the Get Operator 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 | Get Name | | Path | name | 3. Connect the output port (right) of the `currentUser` **Input** operator to the input port (left) of the `Get Name` **Get** operator. #### Configure the Second Create Field Operator 1. Drag and drop a second **Create Field** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Formula | | Label | Add Name | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Preserve Argument Type | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Field 1 | writtenBy=_arg | | Field 2 | date = moment(moment(),'format', 'MM/DD/YYYY') | | Field 3 | | | Field 4 | | | Field 5 | | 3. Connect the output port (right) of the `Add Comment` **Create Field** operator to the input port (left) of the `Add Name` **Create Field** operator. 4. Connect the output port (right) of the `Get Name` **Get** operator to the argument port (top) of the `Add Name` **Create Field** operator. #### Configure the Third Input Operator This Input operator serves as the first input for your Input Switch operator. It brings in any existing comments in your array. If you do not have any comments, then the Input Switch operator chooses a different input. 1. Drag and drop a third **Input** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Input | | Component | commentsTable | | Required | No | | Source | Default | #### Configure the Size Operator This [Size](/v1/docs/size-operator) operator determines whether your `commentsTable` **Hidden** component stores any data. This serves as the argument for the [Input Switch](/v1/docs/input-switch-operator) operator. 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 | Number of Comments | 3. Connect the output port (right) of the `commentsTable` **Input** operator to the input port (left) of the `Number of Comments` **Size** operator. #### Configure the Second Create Table Operator This [Create Table](/v1/docs/create-table-operator) operator serves as the second input for your [Input Switch](/v1/docs/input-switch-operator) operator. If you do not have any existing comments in your array, the Input Switch operator chooses this input. 1. Drag and drop a second **Create Table** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Create Table | | Label | First Comment | | Create Index | | | Number of Rows | | #### Configure the Input Switch Operator The [Input Switch](/v1/docs/input-switch-operator) operator determines whether you have an existing array of comments or if you're starting with your very first comment. It uses the [Size](/v1/docs/size-operator) operator as an argument, choosing between your `commentsTable` **Input** or `First Comment` **Create Table** operators. 1. Drag and drop an **Input Switch** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Input Switch | | Label | If Comments Exist | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Condition | _arg > 0 | 3. Connect the output port (right) of the `commentsTable` **Input** operator to the upper input port (left) of the `If Comments Exist` **Input Switch** operator. 4. Connect the output port (right) of the `First Comment` **Create Table** operator to the lower input port (left) of the `If Comments Exist` **Input Switch** operator. 5. Connect the output port (right) of the `Number of Comments` **Size** operator to the argument port (top) of the `If Comments Exist` **Input Switch** operator. #### Configure the Append Operator 1. Drag and drop an **Append** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Append | | Label | Append Tables | 3. Connect the output port (right) of the `If Comments Exist` **Input Switch** operator to the upper input port (left) of the `Append Tables` **Append** operator. 4. Connect the output port (right) of the `Add Name` **Create Field** operator to the lower input port (left) of the `Append Tables` **Append** 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: | Setting | Value | | --- | --- | | Category | Output | | Component | commentsTable | | Action | value | 3. Connect the output port (right) of the `Append Tables` **Append** operator to the input port (left) of the `commentsTable` **Output** 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: | Setting | Value | | --- | --- | | Category | Output | | Component | initClear | | Action | trigger | 3. Connect the output port (right) of the `Append Tables` **Append** operator to the input port (left) of the `initClear` **Output** 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 | Final Table | 3. Connect the output port (right) of the `Append Tables` **Append** operator to the input port (left) of the `Final Table` **Console** operator. ![A static image displaying the Input Switch operation to manage comments in a Data Workflow.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/UD_InputSwitch_DataWorkflow.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) 4. Click **Save Component**. ### Configure the Button Component Lastly, configure a [Button](https://docs.unqork.io/docs/how-to-guide-button-component) component to trigger your Data Workflow. 1. Drag and drop a **Button** component onto your canvas, placing it between your `comment` **Text Area** and `dwfAddComment` **Data Workflow** components. 2. In the **Property ID** field, enter `btnAddComment`. 3. In the **Label Text** field, enter `Add Comment`. 4. From the **Action Type** drop-down, select **Event.** 5. From the **On Click** drop-down, select **dwfAddComment**. ![A static image displaying the Button configuration for adding comments with event triggers and action types displayed.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/UD_INputSwitch_button.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) 6. Click **Save Component**. 7. **Save** your module. Here's how your completed module looks in the Module Builder: ![A static image displaying the Module Builder configuration with comment section and buttons for adding comments.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/UD_InputSwitch_MB.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) Preview your module in Express View and open the DevTools Console. Enter a comment to view it in the Console. Then, enter another comment and click **Add Comment**. You'll see your new comment added to the same array as your first comment. That way, all your comments exist in one place so you can reference them later. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Dwf_InputSwitch_CommentArray_Express.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) The **Switch** **operator** lets you configure a single [Data Workflow](/v1/docs/data-workflow-component) with two inputs. The operator determines which input to use based on a condition. ## Configuration In this how-to guide, you’ll use the Input Switch operator to create an array of received comments in your application. Doing so requires a [Create Table](https://docs.unqork.io/docs/create-table-operator) operator and an [Input](https://docs.unqork.io/docs/input-operator) operator to add new comments to those already received. To switch between these inputs, you'll add an [Input Switch](https://docs.unqork.io/docs/input-switch-operator) operator. ### Configure the Text Area Component Begin by adding a [Text Area](https://docs.unqork.io/docs/text-area-component) component where end-users can enter comments. 1. In the Module Builder, drag and drop a **Text Area** component onto your canvas. 2. In the **Property ID** field, enter `comment`. 3. In the **Label Text** field, enter `Comment`. 4. Click **Save & Close**. ### Configure the Initializer Component Next, configure an [Initializer](https://docs.unqork.io/docs/initializer-component) component to clear your Text Area after each comment. To do so, you must trigger this Initializer in your Data Workflow in the later steps. 1. Drag and drop an **Initializer** component onto your canvas, placing it above your `comment` Text Area component. 2. In the **Property ID** and **Canvas Label Text** fields, enter `initClear`. 3. In the **Outputs** table, enter the following: | Property ID | Type | Value | | --- | --- | --- | | comment | clear | yes | ![A static image displaying the Initializer component settings for a property ID with clear comment output option.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/CD_InputSwitch_Initializer.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) 4. Click **Save & Close**. ### Configure the Hidden Component Next, configure a [Hidden](https://docs.unqork.io/docs/hidden-component) component to store the output of your Data Workflow. 1. Drag and drop a **Hidden** component onto your canvas, placing it below your `comment` **Text Area** component. 2. In the **Property ID** and **Canvas Label Text** fields, enter `commentsTable`. 3. Click **Save**. ### Configure the Data Workflow Component Now configure your [Data Workflow](https://docs.unqork.io/docs/using-unqorks-dataworkflow). In this example, you'll use many operators to collect your end-user's information and append it. The [Input Switch](/v1/docs/input-switch-operator) operator plays a crucial role in this configuration. You'll connect a [Create Table](/v1/docs/create-table-operator) operator to fire when you receive your first comment. Later, you'll connect an [Input](/v1/docs/input-operator) operator to reference your `commentsTable` **Hidden** component. Then, you'll use a [Size](/v1/docs/size-operator) operator to determine if your [Hidden](/v1/docs/hidden-component) component stores any comments or if it's empty. This Size operator serves as the argument for your Input Switch operator. So, if your Hidden component has a size greater than `0`, the Input Switch chooses that as the input. Doing so lets you keep all your comments in one place. If your Hidden component is empty, the Input Switch chooses your Create Table operator instead. Your Input Switch uses your Create Table operator only for the first comment. For every comment that follows, the Input Switch chooses your Hidden component. 1. Drag and drop a **Data Workflow** component onto your canvas, placing it between your `comment` **Text Area** and `commentsTable` **Hidden** components. 2. In the **Canvas Label Text** and **Property Name** fields, enter `dwfAddComment`. #### 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 | comment | | Required | No | | Source | Default | #### Configure the First Create Table Operator 1. Drag and drop a **Create Table** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Create Table | | Label | New Comment | | Create Index | No | | Number of Rows | 1 | #### Configure the First Create Field Operator 1. Drag and drop a **Create Field** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Formula | | Label | Add Comment | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Preserve Argument Type | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Field 1 | comment=_arg | | Field 2 | | | Field 3 | | | Field 4 | | | Field 5 | | 3. Connect the output port (right) of the `comment` **Input** operator to the argument port (top) of the `Add Comment` **Create Field** operator. 4. Connect the output port (right) of the `New Comment` **Create Table** operator to the input port (left) of the `Add Comment` **Create Field** operator. #### Configure the Second Input Operator 1. Drag and drop a second **Input** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Input | | Component | currentUser | | Required | No | | Source | Default | #### Configure the Get Operator 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 | Get Name | | Path | name | 3. Connect the output port (right) of the `currentUser` **Input** operator to the input port (left) of the `Get Name` **Get** operator. #### Configure the Second Create Field Operator 1. Drag and drop a second **Create Field** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Formula | | Label | Add Name | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Preserve Argument Type | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Field 1 | writtenBy=_arg | | Field 2 | date = moment(moment(),'format', 'MM/DD/YYYY') | | Field 3 | | | Field 4 | | | Field 5 | | 3. Connect the output port (right) of the `Add Comment` **Create Field** operator to the input port (left) of the `Add Name` **Create Field** operator. 4. Connect the output port (right) of the `Get Name` **Get** operator to the argument port (top) of the` Add Name` **Create Field** operator. #### Configure the Third Input Operator This Input operator serves as the first input for your Input Switch operator. It brings in any existing comments in your array. If you do not have any comments, then the Input Switch operator chooses a different input. 1. Drag and drop a third **Input** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Input | | Component | commentsTable | | Required | No | | Source | Default | #### Configure the Size Operator This [Size](/v1/docs/size-operator) operator determines whether your `commentsTable` **Hidden** component stores any data. This serves as the argument for the [Input Switch](/v1/docs/input-switch-operator) operator. 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 | Number of Comments | 3. Connect the output port (right) of the `commentsTable` **Input** operator to the input port (left) of the `Number of Comments` **Size** operator. #### Configure the Second Create Table Operator This [Create Table](/v1/docs/create-table-operator) operator serves as the second input for your [Input Switch](/v1/docs/input-switch-operator) operator. If you do not have any existing comments in your array, the Input Switch operator chooses this input. 1. Drag and drop a second **Create Table** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Create Table | | Label | First Comment | | Create Index | | | Number of Rows | | #### Configure the Input Switch Operator The [Input Switch](/v1/docs/input-switch-operator) operator determines whether you have an existing array of comments or if you're starting with your very first comment. It uses the [Size](/v1/docs/size-operator) operator as an argument, choosing between your `commentsTable` **Input** or `First Comment` **Create Table** operators. 1. Drag and drop an **Input Switch** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Input Switch | | Label | If Comments Exist | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/icon_unchecked(1).png?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) (unchecked) | | Condition | _arg > 0 | 3. Connect the output port (right) of the `commentsTable` **Input** operator to the upper input port (left) of the `If Comments Exist` **Input Switch** operator. 4. Connect the output port (right) of the `First Comment` **Create Table** operator to the lower input port (left) of the `If Comments Exist` **Input Switch** operator. 5. Connect the output port (right) of the `Number of Comments` **Size** operator to the argument port (top) of the `If Comments Exist` **Input Switch** operator. #### Configure the Append Operator 1. Drag and drop an **Append** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Append | | Label | Append Tables | 3. Connect the output port (right) of the `If Comments Exist` **Input Switch** operator to the upper input port (left) of the `Append Tables` **Append** operator. 4. Connect the output port (right) of the `Add Name` **Create Field** operator to the lower input port (left) of the `Append Tables` **Append** 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: | Setting | Value | | --- | --- | | Category | Output | | Component | commentsTable | | Action | value | 3. Connect the output port (right) of the `Append Tables` **Append** operator to the input port (left) of the `commentsTable` **Output** 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: | Setting | Value | | --- | --- | | Category | Output | | Component | initClear | | Action | trigger | 3. Connect the output port (right) of the `Append Tables` **Append** operator to the input port (left) of the `initClear` **Output** 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 | Final Table | 3. Connect the output port (right) of the `Append Tables` **Append** operator to the input port (left) of the `Final Table` **Console** operator. ![A static image displaying the Input Switch operation to manage comments in a Data Workflow.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/CD_InputSwitch_DW.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) 4. Click **Save**. ### Configure the Button Component Lastly, configure a [Button](https://docs.unqork.io/docs/how-to-guide-button-component) component to trigger your Data Workflow. 1. Drag and drop a **Button** component onto your canvas, placing it between your `comment` **Text Area** and `dwfAddComment` **Data Workflow** components. 2. In the **Property ID** field, enter `btnAddComment`. 3. In the **Label Text** field, enter `Add Comment`. 4. Set the **Action Type** as **Event.** 5. From the **On Click** drop-down, select **dwfAddComment**. ![A static image displaying the Button configuration settings with options for actions and user feedback displayed.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/CD_InputSwitch_Button.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) 6. Click **Save & Close**. 7. **Save** your module. Here's how your module looks in the Module Builder: ![A static image displaying the Classic Designer Module Builder configuration for adding comments and clearing input.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/CD_InputSwitch_MB(1).jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%3D) Preview your module in Express View and open the DevTools Console. Enter a comment to view it in the Console. Then, enter another comment and click **Add Comment**. You'll see your new comment added to the same array as your first comment. That way, all your comments exist in one place so you can reference them later. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Dwf_InputSwitch_CommentArray_Express.jpg?sv=2026-02-06&spr=https&st=2026-11-07T17%3A57%3A39Z&se=2026-11-07T18%3A57%3A39Z&sr=c&sp=r&sig=amWTUaF9oT5Kff9g2hHsHOHIUoic0rkuc9J23aj4BIk%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. In Unqork an application is a program used to perform specific tasks. An application can be one of two types: workflow or module. End-users, also known as Express Users, are the individuals accessing an application through Express View. In most cases, end-users are the customers using the product. A Property ID is the unique field ID used by Unqork to track and link components in your module. Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. Triggers activate another component when certain requirements are met. Trigger types include Concurrent, Post, and Error. Some components do not have the ability to trigger others. Canvas Label Text indicates the purpose of the corresponding field or component. For non-input components, the Canvas Label Text isn't end-user facing, and only appears in the . Enter outputs components and actions you want the component to perform. End-users, also known as Express Users, are the individuals accessing an application through Express View. In most cases, end-users are the customers using the product. To execute or perform a a task. In the Operations builder, Events fire (execute) one, or multiple Operations. The action performed by the button when selected. DOM (Document Object Model) events are signals or notifications that something has occurred or is occurring within a web page, often triggered by user interactions or by the browser itself. These events allow JavaScript to react to changes and interactions on a web page, making it dynamic and interactive. 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. A Property ID is the unique field ID used by Unqork to track and link components in your module.