> 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/duplicate-column.md).

# duplicate-column

## Description

<mark style="color:purple;">`duplicate-column`</mark> *adaptor is used to duplicate a column in a datatable*.

To add a new column use the [<mark style="color:purple;">`add-column`</mark> ](/data-flo/reference-guide/add-column.md)adaptor instead.

## Inputs

**`data`**\
Type: `datatable`\
Required: Yes\
The datatable containing the column to be duplicated.

**`column name`**\
Type: `text`\
Required: Yes\
The name of the column to be duplicated.

**`new column name`**\
Type: `text`\
Required: Yes\
The name of the new column.

## Outputs

**`data`**\
Type: `datatable`\
A datatable with the duplicated column.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`data:`

| id | code | countries      |
| -- | ---- | -------------- |
| 1  | GB   | United Kingdom |
| 2  | TR   | Turkey         |
| 3  | US   | United States  |

`column name:` code

`new column name:` country code

#### Outputs:

`data`:

| id | code | countries      | country code |
| -- | ---- | -------------- | ------------ |
| 1  | GB   | United Kingdom | GB           |
| 2  | TR   | Turkey         | TR           |
| 3  | US   | United States  | US           |

-> Created a datatable with a new column named `country code` , duplicating the values from the `code` column.
