Skip to content

Drop Column

Type: drop-column  ·  Package: DataTable Activities v1.0.5  ·  Output: DataTable

Removes one or more columns from a DataTable and returns a new table without them. Useful to keep only the relevant data before writing a report, or to remove internal/temporary columns.

Removes the columns listed in columns from a copy of the table. In the Designer it is edited as a list: one item per column. Each item can be:

  • a column name (case-insensitive), or
  • a position counting from 0. Any numeric value is taken as a position: 2 removes the third column.
  • an expression per item, for example colCount(data) - 1 for the last column.

Positions are resolved against the original table, so you can combine several without them shifting as columns are removed. A text with comma-separated values ("0,2,Internal") or a JSON array is also accepted.

Columns that don’t exist (or out-of-range positions) do not raise an error: they are skipped and the run log shows a warning with how many were skipped. The original table does not change.

ParameterTypeDefaultDescription
tableDataTable—The DataTable to modify.
columnsList | string—Columns to remove: each item is a name or a 0-based position, e.g. ["Internal", "Temp"] or [0, 3].

None.

Returns a new DataTable with the rows of the original and all its columns except the listed ones.

MessageCause and fix
'table' must be a DataTable.table does not evaluate to a DataTable.
'columns' is required.columns is empty or evaluates to null.

If a column is still in the result, check the run log: the warning … column(s) not found and skipped. points to misspelled names.

Remove helper columns before exporting:

Drop Column table = data columns = ["InternalId", "Hash"] → output: clean
Write Excel Sheet path = "C:/out/export.xlsx" data = clean