--- title: "How to: Validate a Value in an Array Using the Includes Operator" slug: "includes-operator-checking-an-array-for-a-value" description: "Learn to use the Includes operator to evaluate roles in an array, confirming if an administrator is present in your data workflow." updated: 2025-11-24T17:19:19Z published: 2025-11-25T16:08:31Z canonical: "docs.unqork.io/includes-operator-checking-an-array-for-a-value" --- > ## 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: Validate a Value in an Array Using the Includes Operator UDesignerClassic Designer The **Includes** **operator** evaluates data for a specific value. If the value is present, it returns **true**; otherwise, it returns **false**. This functionality is similar to the Boolean logic check. In some cases, it might be necessary to verify multiple values and convert the data into an array before evaluating the data. For example, consider a data table containing a list of end-users and their respective roles. You might want to confirm that at least one end-user is an administrator. You can convert the `role` column into an array using the Col2Array operator and use the Includes operator to examine the array. You’ll find the Includes operator under the [Array](https://docs.unqork.io/docs/how-to-guide-array-operators) operators group to the left of the [Data Workflow](https://docs.unqork.io/docs/unqorks-data-workflow-operators) canvas. ## Configuration In this example, you'll learn how to use the Includes operator to confirm a value in an array. > [!NOTE] > These instructions assume you have a new module open, saved with a title. ### Configure the Data Table Component Begin by adding a [Data Table](https://docs.unqork.io/docs/data-table-component) component with a list of end-users and their roles. 1. In the Module Builder, drag and drop a **Data Table** component onto your canvas. 2. In the **Property ID** field, enter `dtUsers`. 3. In the data table, enter the following: | # | A | B | | --- | --- | --- | | 1 | userName | role | | 2 | rmoose | architect | | 3 | kbell | administrator | | 4 | rgreen | authenticated | | 5 | cbing | client | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(325).png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) 4. Click **Save Component**. ### Configure the Data Workflow Component Now, configure your [Data Workflow](https://docs.unqork.io/docs/using-unqorks-dataworkflow) component. Here, you'll use a Col2Array operator to convert the `role` column of your data table into an array. The Col2Array operator passes that data to the Includes operator, which determines if it contains the `administrator` role. Lastly, you'll add a Console operator to view the process. 1. Drag and drop a **Data Workflow** component onto your canvas, placing it below your `dtUsers` **Data Table** component. 2. In the **Property ID** and **Canvas Label Text** fields, enter `dwfIncludesArray`. 3. From the **Trigger Type** drop-down, select **Watch**. #### 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 | dtUsers | | Required | Yes | | Source | Default | #### Configure the Col2Array Operator 1. Drag and drop a **Col2Array** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Col2Array | | Label | Col2Array Role | | 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-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) (unchecked) | | Drop Empty | No | | Path | role | | Default Value | | 3. Connect the output port (right) of the `dtUsers` **Input** operator to the input port (left) of the `Col2Array Role` **Col2Array** operator. #### Configure the Includes Operator 1. Drag and drop an **Includes** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Includes | | Label | Role Array Includes Administrator | | Value | administrator | 3. Connect the output port (right) of the `Col2Array Role` **Col2Array** operator to the input port (left) of the `Role Array Includes Administrator` **Includes** 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 | Does the role array include administrator? | 3. Connect the output port (right) of the `Role Array Includes Administrator` **Includes** operator to the input port (left) of the `Does the role array include administrator?` **Console** operator. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(327).png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) 4. Click **Save Component**. 5. **Save** your module. Here's how your module looks in the Module Builder: ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(328).png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) Because this example runs in the background, you won't see the results unless you open the DevTools Console. Preview your module in Express View and open the DevTools Console, the Includes operator checks the array for the `administrator` role, and the `Does the role array include administrator?` **Console** operator displays the value as `true`. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Dwf_IncludesOperator_Array_Console(1).jpg?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) The **Includes** **operator** evaluates data for a specific value. If the value is present, it returns **true**; otherwise, it returns **false**. This functionality is similar to the Boolean logic check. In some cases, it might be necessary to verify multiple values and convert the data into an array before evaluating the data. For example, consider a data table containing a list of end-users and their respective roles. You might want to confirm that at least one end-user is an administrator. You can convert the `role` column into an array using the Col2Array operator and use the Includes operator to examine the array. You’ll find the Includes operator under the [Array](https://docs.unqork.io/docs/how-to-guide-array-operators) operators group to the left of the [Data Workflow](https://docs.unqork.io/docs/unqorks-data-workflow-operators) canvas. ## Configuration In this example, you'll learn how to use the Includes operator to confirm a value in an array. > [!NOTE] > These instructions assume you have a new module open, saved with a title. ### Configure the Data Table Component Begin by adding a [Data Table](https://docs.unqork.io/docs/data-table-component) component with a list of end-users and their roles. 1. In the Module Builder, drag and drop a **Data Table** component onto your canvas. 2. In the **Label** and **Property Name** fields, enter `dtUsers`. 3. In the data table, enter the following: | # | A | B | | --- | --- | --- | | 1 | userName | role | | 2 | rmoose | architect | | 3 | kbell | administrator | | 4 | rgreen | authenticated | | 5 | cbing | client | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(331).png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) 4. Click **Save**. ### Configure the Data Workflow Component Now, configure your [Data Workflow](https://docs.unqork.io/docs/using-unqorks-dataworkflow) component. Here, you'll use a Col2Array operator to convert the `role` column of your data table into an array. The Col2Array operator passes that data to the Includes operator, which determines if it contains the `administrator` role. Lastly, you'll add a Console operator to view the process. 1. Drag and drop a **Data Workflow** component onto your canvas, placing it below your `dtUsers` **Data Table** component. 2. In the **Canvas Label Text** and **Property Name** fields, enter `dwfIncludesArray`. 3. From the **Trigger Type** drop-down, select **Watch**. #### 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 | dtUsers | | Required | Yes | | Source | Default | #### Configure the Col2Array Operator 1. Drag and drop a **Col2Array** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Col2Array | | Label | Col2Array Role | | 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-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) (unchecked) | | Drop Empty | No | | Path | role | | Default Value | | 3. Connect the output port (right) of the `dtUsers` **Input** operator to the input port (left) of the `Col2Array Role` **Col2Array** operator. #### Configure the Includes Operator 1. Drag and drop an **Includes** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Includes | | Label | Role Array Includes Administrator | | Value | administrator | 3. Connect the output port (right) of the `Col2Array Role` **Col2Array** operator to the input port (left) of the `Role Array Includes Administrator` **Includes** 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 | Does the role array include administrator? | 3. Connect the output port (right) of the `Role Array Includes Administrator` **Includes** operator to the input port (left) of the `Does the role array include administrator?` **Console** operator. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(332).png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) 4. Click **Save**. 5. **Save** your module. Here's how your module looks in the Module Builder: ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(335).png?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) Because this example runs in the background, you won't see the results unless you open the DevTools Console. Preview your module in Express View and open the DevTools Console, the Includes operator checks the array for the `administrator` role, and the `Does the role array include administrator?` **Console** operator displays the value as `true`. ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Dwf_IncludesOperator_Array_Console(1).jpg?sv=2026-02-06&spr=https&st=2026-11-08T18%3A01%3A10Z&se=2026-11-08T19%3A01%3A10Z&sr=c&sp=r&sig=a%2FhIOFKUqb65ZgrT9ujwHYjIsSmngql8apua%2BX3CeqU%3D) The Boolean data type accepts one of two values: true, or, false. An array is a type of object that stores one or more data types. Data types supported in arrays include numbers, strings, and objects. 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. 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. 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 . Deteremines how the component triggers. Label Text conveys what the input component is and what information it displays. Enter the purpose of the corresponding component or field. 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. ## Related - [Data Workflow Component](/data-workflow-component.md) - [Introduction to Data Workflow](/introduction-to-data-workflow.md)