Drop Column
Drop Column
Section titled “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.
How it works
Section titled “How it works”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:
2removes the third column. - an expression per item, for example
colCount(data) - 1for 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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
table | DataTable | — | The DataTable to modify. |
columns | List | string | — | Columns to remove: each item is a name or a 0-based position, e.g. ["Internal", "Temp"] or [0, 3]. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”Returns a new DataTable with the rows of the original and all its columns except the listed ones.
Common errors
Section titled “Common errors”| Message | Cause 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.
Example
Section titled “Example”Remove helper columns before exporting:
Drop Column table = data columns = ["InternalId", "Hash"] → output: cleanWrite Excel Sheet path = "C:/out/export.xlsx" data = cleanRelated activities
Section titled “Related activities”- Rename Column — rename instead of removing.
- Add Column — add a calculated column.