--- title: "Clean Object Operator" slug: "clean-object-operator" description: "Clean your data effortlessly with the Clean Object operator, removing nulls and ensuring compatibility for sensitive API calls." updated: 2025-11-25T16:09:52Z published: 2025-11-25T16:09:52Z canonical: "docs.unqork.io/clean-object-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. # Clean Object Operator UDesignerClassic Designer ![A static image displaying the Clean Object operator with its Info window.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Clean Object UD.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) The **Clean Object** **operator** helps sanitize data by removing null values, converting them to empty strings, or transforming all values into strings. This operator is especially useful when preparing data for APIs, which can be sensitive to unexpected or incorrect field types. For example, an API call might fail if a field receives a null or a string instead of a number. Use this operator to ensure the data you send is clean and compatible. There are various ways you can clean a data object: - **Omit Null**: Removes any fields with a null value. - **Set Null to Empty String**: Converts all null values to empty strings (`""`). - **Convert All to String**: Converts all values to strings. All of these action types clean up the entire data object, including any nested objects. You'll find the Clean Object operator under the [Object Operators](https://docs.unqork.io/docs/object-operator-types) group to the left of your [Data Workflow](https://docs.unqork.io/docs/data-workflow-component) canvas. ## About the Info Window Here's a breakdown of each setting in the 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. | | Clean Action | Sets the type of action the operator performs. The three options are: - **Omit Null**: Removes any fields with a null value**.** - **Set Null to Empty String**: Converts all null values to empty strings (`""`). - **Convert All to String**: Converts all values to strings. | ## Adding a Clean Object Operator First, configure a [Data Table](https://docs.unqork.io/docs/data-table-component) component with sample values so you can use a [Data Workflow](https://docs.unqork.io/docs/data-workflow-component) to generate null values. Use the **Convert All to String** action type to observe how numbers and nulls are converted to strings. ### Configure the Data Table Component Configure a Data Table component with companies and their values. 1. In the Module Builder, drag and drop a **Data Table** component onto your canvas. 2. In the **Property ID** field, enter `dtSampleData`. 3. In the data table, enter the following: | | A | B | | --- | --- | --- | | 1 | value | company | | 2 | 12 | Unqork | | 3 | 34 | Cvent | | 4 | 56 | Trustpilot | | 5 | 78 | BetterWorks | | 6 | 90 | J.P. Morgan | ![A static image displaying the dtSampleData Data table.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image(160).png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) 4. Click **Save Component**. ### Configure the Hidden Components Before you add your Data Workflow components, you'll need components to store the outputs. You'll use two [Hidden](https://docs.unqork.io/docs/hidden-component) components, one for each Data Workflow. 1. Drag and drop two **Hidden** components onto your canvas, placing them below the `dtSampleData` **Data Table** component. 2. Enter the following **Property ID** and **Canvas Label Text** values: | Property ID | Canvas Label Text | | --- | --- | | dataWithNullValues | dataWithNullValues | | allStrings | allStrings | 3. Click **Save Component** for each component as you add it. ### Configure the First Data Workflow Component 1. Drag and drop a **Data Workflow** component onto your canvas, placing it between the `dtSampleData` **Data Table** and **Hidden** components. 2. In the **Property ID** and **Canvas Label Text** fields, enter `dwfCreateNullValues`. ![A static image displaying the configuration of the dwfCreateNullValues Data Workflow.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Clean%20Object%20Operator_dwfCreateNullValues.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%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 | dtSampleData | | Required | Yes | | Source | Default | #### Configure the Create Field Operator This operator adds a new `testField` field with a value of `null` to each object in the data. 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 | testField=NULL | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Checked_Box(7).png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) (checked) | | Field 1 | testField=NULL | | Field 2 | | | Field 3 | | | Field 4 | | | Field 5 | | 3. Connect the output port (right) of the `dtSampleData` **Input** operator to the input port (left) of the `testField=NULL` **Create Field** 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 | dataWithNullValues | | Action | value | 3. Connect the output port (right) of the `testField=NULL` **Create Field** operator to the input port (left) of the `dataWithNullValues` **Output** operator. 4. Click **Save**. ### Configure the Second Data Workflow Component 1. Drag and drop another **Data Workflow** component onto your canvas, placing it between the `dataWithNullValues` and `allStrings` **Hidden** components. 2. In the **Property ID** and **Canvas Label Text** fields, enter `dwfCleanObject`. ![A static image displaying the configuration of the dwfCleanObject Data Workflow.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Clean%20Object%20Operator_dwfCleanObject.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%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 | dataWithNullValues | | Required | Yes | | Source | Default | #### Configure the Clean Object Operator The Clean Object operator converts all the values from the `dataWithNullValues` **Input** operator. 1. Drag and drop a **Clean Object** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Clean Object | | Label | Convert to String | | Clean Action | Convert all to String | 3. Connect the output port (right) of the `dataWithNullValues` **Input** operator to the input port (left) of the `Convert to String` **Clean Object** 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 | allStrings | | Action | value | 3. Connect the output port (right) of the `Convert to String` **Clean Object** operator to the input port (left) of the `allStrings` **Output** operator. 4. Click **Save Component**. 5. **Save** your module. Here's how the completed example looks in the Module Builder: ![A static image displaying the Module Definition created for the use case to explain the Clean Object operator.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Picture1(7).png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) Preview your module in Express View and open the DevTools Console. You'll see that the number and null values are now strings. ![A static image displaying the Express View and the DevTools Console of the configuration we build in the Module Builder.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image-1762849583476.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) ![A static image displaying the Clean Object and its Info window.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Clean Object CD.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D)The **Clean Object** **operator** helps sanitize data by removing null values, converting them to empty strings, or transforming all values into strings. This operator is especially useful when preparing data for APIs, which can be sensitive to unexpected or incorrect field types. For example, an API call might fail if a field receives a null or a string instead of a number. Use this operator to ensure the data you send is clean and compatible. There are various ways you can clean a data object: - **Omit Null**: Removes any fields with a null value. - **Set Null to Empty String**: Converts all null values to empty strings (`""`). - **Convert All to String**: Converts all values to strings. All of these action types clean up the entire data object, including any nested objects. You'll find the Clean Object operator under the [Object Operators](https://docs.unqork.io/docs/object-operator-types) group to the left of your [Data Workflow](https://docs.unqork.io/docs/data-workflow-component) canvas. ## About the Info Window Here's the breakdown of each setting in the 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. | | Clean Action | Sets the type of action the operator performs. The three options are: - **Omit Null**: Removes any fields with a null value**.** - **Set Null to Empty String**: Converts all null values to empty strings (`""`). - **Convert All to String**: Converts all values to strings. | ## Adding a Clean Object Operator First, configure a [Data Table](https://docs.unqork.io/docs/data-table-component) component with sample values so you can use a [Data Workflow](https://docs.unqork.io/docs/data-workflow-component) to generate null values. Use the **Convert All to String** action type to observe how numbers and nulls are converted to strings. ### Configure the Data Table Component Configure a Data Table component with companies and their values. 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 `dtSampleData`. 3. In the data table, enter the following: | # | A | B | | --- | --- | --- | | 1 | value | company | | 2 | 12 | Unqork | | 3 | 34 | Cvent | | 4 | 56 | Trustpilot | | 5 | 78 | BetterWorks | | 6 | 90 | J.P. Morgan | ![A static image displaying the dtSampleData Data Table configuration.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/CD_Clean%20Object%20Operator_dtSampleData.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) 4. Click **Save & Close**. ### Configure the Hidden Components Before you add your Data Workflow components, you'll need components to store the outputs. You'll use two [Hidden](https://docs.unqork.io/docs/hidden-component) components, one for each Data Workflow. 1. Drag and drop two **Hidden** components onto your canvas, placing them below the `dtSampleData` **Data Table** component. 2. Enter the following **Property ID** and **Canvas Label Text** values: | Property ID | Canvas Label Text | | --- | --- | | dataWithNullValues | dataWithNullValues | | allStrings | allStrings | 3. **Save & Close** each component as you add it. ### Configure the First Data Workflow Component 1. Drag and drop a **Data Workflow** component onto your canvas, placing it between the `dtSampleData` **Data Table** and Hidden components. 2. In the **Canvas Label Text** and **Property Name** fields, enter `dwfCreateNullValues`. ![A static image displaying the configuration of the dwfCreateNullValues Data Workflow.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/CD_Clean%20Object%20Operator_dwfCreateNullValues.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%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 | dtSampleData | | Required | Yes | | Source | Default | #### Configure the Create Field Operator This operator adds a new `testField` field with a value of `null` to each object in the data. 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 | testField=NULL | | Do Not Sanitize Formula | ![](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/Checked_Box(7).png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) (checked) | | Field 1 | testField=NULL | | Field 2 | | | Field 3 | | | Field 4 | | | Field 5 | | 1. Connect the output port (right) of the `dtSampleData` **Input** operator to the input port (left) of the `testField=NULL` **Create Field** 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 | dataWithNullValues | | Action | value | 3. Connect the output port (right) of the `testField=NULL` **Create Field** operator to the input port (left) of the `dataWithNullValues` **Output** operator. 4. Click **Save**. ### Configure the Second Data Workflow Component 1. Drag and drop another **Data Workflow** component onto your canvas, placing it between the `dataWithNullValues` and `allStrings` **Hidden** components. 2. In the **Canvas Label Text** and **Property Name** fields, enter `dwfCleanObject`. ![A static image displaying the configuration of the dwfCleanObject Data Workflow component.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image-1762856115310.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%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 | dataWithNullValues | | Required | Yes | | Source | Default | #### Configure the Clean Object Operator The Clean Object operator converts all the values from the `dataWithNullValues` **Input** operator. 1. Drag and drop a **Clean Object** operator onto your Data Workflow canvas. 2. Configure the operator's **Info** window as follows: | Setting | Value | | --- | --- | | Category | Clean Object | | Label | Convert to String | | Clean Action | Convert all to String | 3. Connect the output port (right) of the `dataWithNullValues` **Input** operator to the input port (left) of the `Convert to String` **Clean Object** 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 | allStrings | | Action | value | 3. Connect the output port (right) of the `Convert to String` **Clean Object** operator to the input port (left) of the `allStrings` **Output** operator. 4. Click **Save**. 5. **Save** your module. Here's how the completed example looks in the Module Builder: ![A static image displaying the module definition used to explain the Clean Object operator.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/CD_Clean%20Object%20Operator_Module.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) Preview your module in Express View and open the DevTools Console. You'll see that the number and null values are now strings. ![A static image displaying the Express View and the DevTools Console of the configuration we build in the Module Builder.](https://cdn.us.document360.io/15548f06-2fba-434c-b0c1-5df88317dbd7/Images/Documentation/image-1762849583476.png?sv=2026-02-06&spr=https&st=2026-11-10T12%3A00%3A21Z&se=2026-11-10T13%3A00%3A21Z&sr=c&sp=r&sig=yWzWImTmLkyiFjyhG%2ByKSkqnKIkDpkcCRAgAHIWqtIw%3D) A string is an object that represents a sequence of characters. Strings typically hold data represented in text form. APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. APIs (application programming interfaces) are a set of protocols and definitions developers use to build and integrate application software. APIs act as the connective tissue between products and services. 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)