# 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>](https://cgps.gitbook.io/data-flo/reference-guide/replace-values-in-columns) 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cgps.gitbook.io/data-flo/reference-guide/replace-blank-values.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
