> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/replace-blank-values.md).

# replace-blank-values

## Description

<mark style="color:purple;">`replace-blank-values`</mark> *adaptor replaces blank values in a datatable column.*

This adaptor only replaces blank values, to replace existing values in a datatable column, use the  [<mark style="color:purple;">`replace-values-in-columns`</mark>](/data-flo/reference-guide/replace-values-in-columns.md) adaptor. This adaptor may be used for a single column, or replacing blank values across multiple columns.

## Inputs

**`data`**\
Type: `datatable`\
Required: Yes\
The datatable containing blank values.

**`columns`**\
Type: `list`\
Required: Yes\
The names of the columns in `data` containing blank values.

**`new value`**\
Type: `text`\
Required: Yes\
A value to replace blank values.

## Outputs

**`data`**\
Type: `datatable`\
A datatable with the blank values replaced.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`data:`

| id | code | name           |
| -- | ---- | -------------- |
| 1  | GB   | United Kingdom |
| 2  | TR   | Turkey         |
| 3  | US   |                |
| 4  | IND  | India          |
| 5  | IND  | India          |
| 6  | us   |                |

`columns:`

1. name

`new value:` United States

#### Outputs:

`data`:

| id | country code | country name   |
| -- | ------------ | -------------- |
| 1  | GB           | United Kingdom |
| 2  | TR           | Turkey         |
| 3  | US           | United States  |
| 4  | IND          | India          |
| 5  | IND          | India          |
| 6  | us           | United States  |

-> Replaced the blank values with `United States` in the datatable.

### Example 2: Replace blank values in multiple columns.

#### Inputs:

`data:`

| id | code | name           |
| -- | ---- | -------------- |
| 1  | GB   | United Kingdom |
| 2  |      | Turkey         |
| 3  | US   |                |
| 4  | IND  | India          |
| 5  |      | India          |
| 6  | us   |                |

`columns:`

1. code, name

`new value:` Missing

#### Outputs:

`data`:

| id | country code | country name   |
| -- | ------------ | -------------- |
| 1  | GB           | United Kingdom |
| 2  | Missing      | Turkey         |
| 3  | US           | Missing        |
| 4  | IND          | India          |
| 5  | Missing      | India          |
| 6  | us           | Missing        |

-> Replaced the blank values in the code and name columns with `Missing` in the datatable.

## Use Cases

* Standardise values for missing information.
* Filling in a column after joining datatables.
