---
title: Replace null values
description: Replace null or empty values in selected columns using user-defined default values.
category: Data Preparation
tags: [null, replace, imputation, fill, datacleaning, transformation]
---

# Replace null values

## Description

he **Replace Null Values** activity is designed to automatically fill missing or empty entries in your dataset, helping ensure data completeness and integrity for downstream processing.

It works by allowing users to define a list of specific columns where null (`null`) or blank (`""`) values may exist. For each such column, a default **replacement value** can be configured along with the expected **data type**. The activity then traverses each row and substitutes any null or blank cell with the appropriate typed value.

Supported data types include:

- **String** – e.g., `"Unknown"`, `"N/A"`, `"Not Provided"`
- **Number** – e.g., `0`, `-1`, or any decimal/integer value
- **Date** – e.g., `"2023-01-01"` (must be parsable in common formats)
- **Boolean** – e.g., `true` or `false`

This activity is especially useful in cases where:

- Downstream activities (like filters, aggregations, or joins) depend on non-null values.
- You're preparing datasets for machine learning, reporting, or transformation pipelines.
- Clean, uniform inputs are essential — such as dashboards or business rules relying on default fallbacks.

By replacing incomplete data in a structured and type-safe manner, this activity simplifies pre-processing while preserving schema consistency.

> **Tip:** Only columns with explicitly defined mappings will be processed. All other columns remain unchanged.

---

## Input

| **Field** | **Description**                          |
| --------- | ---------------------------------------- |
| Data      | Tabular data from the previous activity. |

---

## Output

| **Field** | **Description**                                                             |
| --------- | --------------------------------------------------------------------------- |
| Data      | The transformed table with null/empty values replaced in specified columns. |

---

## Configuration Fields

| **Field**   | **Required** | **Description**                                                                |
| ----------- | ------------ | ------------------------------------------------------------------------------ |
| Columns Map | Yes          | List of column mappings to fill. Each map defines the column, value, and type. |

Each `Columns Map` item includes:

| **Subfield** | **Required** | **Description**                                   |
| ------------ | ------------ | ------------------------------------------------- |
| Column Name  | Yes          | Name of the column to fill if null or empty.      |
| Data Type    | Yes          | The type of value (String, Number, Date, Boolean) |
| Value        | Yes          | The default value to use when cell is null/empty  |

## Sample Input

| Name  | Country | Age | JoinedOn   | IsActive |
| ----- | ------- | --- | ---------- | -------- |
| Alice | India   | 30  | 2023-04-10 | true     |
| Bob   |         |     |            |          |
| Carol | UK      | 22  | 2023-02-18 | false    |

---

---

## Sample Configuration

| Column Name | Data Type | Value      |
| ----------- | --------- | ---------- |
| Country     | String    | Unknown    |
| Age         | Number    | 0          |
| JoinedOn    | Date      | 2023-01-01 |
| IsActive    | Boolean   | true       |

---

## Sample Output

| Name  | Country | Age | JoinedOn   | IsActive |
| ----- | ------- | --- | ---------- | -------- |
| Alice | India   | 30  | 2023-04-10 | true     |
| Bob   | Unknown | 0   | 2023-01-01 | true     |
| Carol | UK      | 22  | 2023-02-18 | false    |

---
