add-column

Adds a new column to an existing datatable

Simply add an empty column to the end of your datatable, or add a column with a single specific value.

TIP: use extend-datatable instead if you need to add columns with more complex values

Arguments

Inputs

data: The datatable to which the new column will be added.

column: The name of the new column to be added. (If there is already a column with this name, Data-flo will throw an error)

value: The value to be added to the column cells. If unspecified, empty values will be added.

Outputs

data: A datatable with the new column added.

Example

Possible use cases

  • Create an empty column for use in conjunction with other adaptors.

  • A datatable contains data from a specific date or user, but doesn't specify that information. Before combining two similar datatables, add a column to each that describes the source (similar to adding a column to a spreadsheet with the filename in the column). Then, when the datatables are combined, it will be clear which rows came from which datatable.

  • Use Data-flo to create a spreadsheet including some existing data, as well as some standardized empty columns for later users to fill in.

Last updated