Skip to content

Add Column

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

Adds a new calculated column to a DataTable: for each row, it evaluates an expression and stores the result in the column. Use it to derive data from existing data — a total with tax, a category, an “overdue” flag, a combined text.

Copies the table (columns and rows) and appends the column at the end. Then it walks the rows evaluating the value expression. The row’s columns are available as variables inside that expression: you can reference them directly by name, together with the flow’s variables. It returns the new table; the original does not change.

  • The new column accepts any type of value (object); each cell stores whatever the expression returns. If the expression returns null, the cell is left empty (DBNull).
  • Inside the expression, an empty cell arrives as null.
  • If value is a fixed value (for example "Pending"), every row gets that same value.
ParameterTypeDefaultDescription
tableDataTable—The DataTable to extend.
columnstring—Name of the new column. It must not already exist in the table.
valueobject—Expression evaluated on each row. The row’s columns are injected as variables with their names.

None.

Returns a new DataTable with all the columns and rows of the original plus the added column at the end.

MessageCause and fix
'table' must be a DataTable.table does not evaluate to a DataTable.
'column' is required.The new column name is missing.
A column named '…' already belongs to this DataTable.A column with that name already exists (.NET message). Pick another name or remove the existing one with Drop Column.
Expression errorThe value expression failed on some row (for example, converting an empty cell). Use num(...) and str(...) to handle empty cells.

Add a TotalWithTax column computed from the Total column:

Add Column table = invoices column = "TotalWithTax" value = num(Total) * 1.19 → output: withTax
Aggregate Column table = withTax column = "TotalWithTax" operation = sum → output: totalWithTax

Here Total refers to the Total column of the current row. Wrap it in num(...) or str(...) to handle the cell value safely.

Add Column table = customers column = "Greeting" value = "Dear " + str(Name) → output: withGreeting