Remove Column
Removes a specified column from a data table.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Table - The input data table from which to remove a column.
- Column Name - The name of the column to be removed.
Options
- Output Type - Specifies whether to pass the table by reference or by value. Options are:
- Pass By Reference
- Pass By Value
Output
- Table - The resulting data table with the specified column removed.
How It Works
The Remove Column node removes a specified column from a data table. When executed, the node:
- Validates that the input table is not empty and is valid
- Checks if the table is a reference table and handles it appropriately
- Validates that the column name is not empty
- Converts the data table to a pandas DataFrame
- Removes the specified column from the DataFrame
- Converts the modified DataFrame back to the data table format
- Returns the updated table
Requirements
- A valid input data table
- A valid column name that exists in the table
Error Handling
The node will return specific errors in the following cases:
| Condition | What causes it | How to fix it |
|---|---|---|
| Empty or invalid input table | The upstream node produced nothing, or the Table variable name does not match | Check the output variable of the node that built the table |
| Empty column name | Column Name was left blank, or a Message variable resolved to empty | Set Column Name as a literal, or check the upstream variable |
| Invalid table structure | Rows are positional arrays, or the shape uses header instead of columns | Use {columns: [...], rows: [{key: value}]} with row keys matching column names |
| Column name does not exist | A typo, a case mismatch, or a CSV header with surrounding whitespace | Compare against the header row of the source; the match is exact and case-sensitive |
Usage Examples
Example 1: Drop a Column Before Writing a CSV
- CSV To Data Table (export.csv) -> table
- Remove Column:
- Table: table
- Column Name: internal_id
- Table (out): table
- Data Table To CSV (table, clean.csv)
In the SDK:
.then('a06926', 'Robomotion.Pandas.RemoveColumn', 'Drop Internal Id', {
inTable: Message('table'),
inColumnName: Custom('internal_id'),
outTable: Message('table')
})
Example 2: Drop Several Columns
The node removes one column per call, so chain it and write back to the same variable each time:
.then('b17c34', 'Robomotion.Pandas.RemoveColumn', 'Drop Email', {
inTable: Message('table'),
inColumnName: Custom('email'),
outTable: Message('table')
})
.then('c28d45', 'Robomotion.Pandas.RemoveColumn', 'Drop Phone', {
inTable: Message('table'),
inColumnName: Custom('phone'),
outTable: Message('table')
})
Example 3: Strip Personal Data from a Spreadsheet
A common shape: read an internal workbook, drop the columns that must not leave the building, and write the file you actually send out.
.then('d39e56', 'Robomotion.Pandas.ExcelToDataTable', 'Read Workbook', {
inPath: Custom('/data/salaries.xlsx'),
outTable: Message('table')
})
.then('e40f67', 'Robomotion.Pandas.RemoveColumn', 'Drop Salary', {
inTable: Message('table'),
inColumnName: Custom('salary'),
outTable: Message('table')
})
.then('f51a78', 'Robomotion.Pandas.DataTableToCSV', 'Write Shareable CSV', {
inTable: Message('table'),
inPath: Custom('/data/headcount.csv'),
optOverwriteIfExists: true
})
Example 4: Remove a Column from a Large Table by Reference
For tables too large to copy between nodes:
.then('a62b89', 'Robomotion.Pandas.RemoveColumn', 'Drop Raw Payload', {
inTable: Message('table'),
inColumnName: Custom('raw_payload'),
optReference: 'True',
outTable: Message('table')
})
Example 5: Keep the Original Table Intact
Writing the result to a different variable leaves the input table untouched, so a later step can still read the removed column:
.then('b73c90', 'Robomotion.Pandas.RemoveColumn', 'Public Copy', {
inTable: Message('table'),
inColumnName: Custom('cost_price'),
outTable: Message('public_table')
})
Usage Notes
- The Output Type option can be set to "Pass By Reference" for handling large tables more efficiently
- The node permanently removes the specified column from the table
- All data in the removed column is lost
- The node supports removing any column from the table regardless of its position
Tips
- Output Type is the string
TrueorFalse, not a boolean.optReference: 'True'is correct;optReference: truewill not parse. The same applies to the Order Type option on Sort Table - The column name is matched exactly, including case. A CSV header written as
First Namewill not matchfirst name - One node removes one column. To drop five, chain five nodes, or use Query if it is easier to describe the rows you want to keep
- To keep the original, send the result to a different output variable rather than overwriting the
input, as in Example 5. Writing
outTableback to the same name is the usual case and is what makes a chain of removals read cleanly - Pass By Reference avoids copying the table between nodes and is worth using once tables get large; the trade-off is that downstream nodes see the same underlying table
- There is no "remove all columns except these" option. When the keep-list is much shorter than the drop-list, build a new table in a Function node instead of chaining a dozen removals
- Every node in this package expects the standard table shape
(
{columns: [...], rows: [{key: value}]}), so build tables with a Function node before removing anything
Related Nodes
- Add Column - The inverse operation
- Get Column - Read a column's values without changing the table
- Remove Row - Drop a row instead of a column
- Query - Filter rows with an expression
- CSV To Data Table - Load a table from CSV
- Data Table To CSV - Write the trimmed table out