Column
Create column(s) with a user defined value. Defaults to None (empty).
Create column(s) with a user defined value. Defaults to None (empty). If you need to copy an existing column, use the copy wrangle instead.
Parameters
| Name | Description | Accepted Values | Default | Required |
|---|---|---|---|---|
| I/O | ||||
output | Name or list of names of new columns or column_name: value pairs. | string, array | — | Yes |
| Options | ||||
value | (Optional) Value(s) to add in the new column(s). If using a dictionary in output, value can only be a string. | string, number, object, array, boolean, null | null | No |
value_if_exists | Determines behaviour when the output column already exists. existing (default): leave the column unchanged. coalesce: fill empty/null cells with the new value, keeping non-null cells. new: overwrite the entire column with the new value. | string; one of:
| "existing" | No |
coalesce_value | Only used when value_if_exists is coalesce. Determines which side is preferred when both the existing and new values are non-empty. existing (default): keep the existing value, only fill empty/null cells with the new value. new: keep the new value, only fall back to the existing value where the new value is empty/null. | string; one of:
| "existing" | No |
| Conditions | ||||
if | Condition that determines whether the wrangle runs as a whole. Recipe variables may be referenced with ${variable}. | string | — | No |
where | Filter rows before applying the wrangle using SQL-like criteria, such as column1 = 123 OR column2 = 'abc'. | string | — | No |
where_params | Values used with where for parameterized criteria. Uses SQLite placeholder syntax such as ? or :name. | array, object | — | No |
Examples
wrangles:
- create.column:
output: New Column
value: new value # Optional, otherwise empty
where: column > 1
| column |
|---|
| 1 |
| 2 |
| 3 |
| New Column |
|---|
| new value |
| new value |
wrangles:
- create.column:
output:
- New Column 1: new value 1 # Optional, otherwise empty
- New Column 2: new value 2
- New Column 3: new value 1
| column |
|---|
| 1 |
| 2 |
| 3 |
| New Column 1 | New Column 2 | New Column 3 |
|---|---|---|
| new value 1 | new value 2 | new value 1 |
| new value 1 | new value 2 | new value 1 |
| new value 1 | new value 2 | new value 1 |
wrangles:
- create.column:
output:
- New Column:
- 4
- 5
- 6
| column |
|---|
| 1 |
| 2 |
| 3 |
| New Column |
|---|
| [4, 5, 6] |
| [4, 5, 6] |
| [4, 5, 6] |
Columns of empty lists can also be created by passing an empty list ([]) as the column value.
Access
| Requirement | Value |
|---|---|
| AI-powered | No |
| Requires WrangleWorks account | No |
| Requires subscription | No |
| Requires external API key | No |
Technical details
| Field | Value |
|---|---|
| Catalog ID | 13 |
| Catalog key | create.column |
| Recipe key | create.column |
| Catalog status | active |
| Lifecycle status | active |
| Recipe Writer eligible | Yes |
| Namespace | create |
| Documentation group | create |
| Aliases | None |
| Runtime symbol | wrangles.recipe_wrangles.create.column |
| Legacy UUID | 5a18e2c8-ec7c-45f5-88fd-bb5c358a8b40 |
Sources