Skip to main content

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:

  1. Validates that the input table is not empty and is valid
  2. Checks if the table is a reference table and handles it appropriately
  3. Validates that the column name is not empty
  4. Converts the data table to a pandas DataFrame
  5. Removes the specified column from the DataFrame
  6. Converts the modified DataFrame back to the data table format
  7. 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:

ConditionWhat causes itHow to fix it
Empty or invalid input tableThe upstream node produced nothing, or the Table variable name does not matchCheck the output variable of the node that built the table
Empty column nameColumn Name was left blank, or a Message variable resolved to emptySet Column Name as a literal, or check the upstream variable
Invalid table structureRows are positional arrays, or the shape uses header instead of columnsUse {columns: [...], rows: [{key: value}]} with row keys matching column names
Column name does not existA typo, a case mismatch, or a CSV header with surrounding whitespaceCompare 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 True or False, not a boolean. optReference: 'True' is correct; optReference: true will 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 Name will not match first 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 outTable back 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