Skip to content

Join DataTable

Type: join-datatable  ·  Package: DataTable Activities v1.0.5  ·  Output: DataTable

Combines two DataTables into one, matching their rows on a common column (a key). It works like a SQL JOIN or an Excel VLOOKUP: it lets you enrich one table with data from another — for example, join sales with the customer catalog to have the name and email next to each sale.

Matches each row of the left table (left) with the rows of the right table (right) that have the same value in the on column (which must exist in both). The type parameter decides what happens to unmatched rows:

  • inner (default): keeps only the rows that have a match in both tables.
  • left: keeps all rows from the left; those without a match on the right have those columns empty.

Matching details:

  • Keys are compared as text and case-insensitively ("A-10" matches "a-10"). Empty cells on both sides match each other.
  • If a left row has several matches on the right, the result has one row per match.
  • Rows come out in the order of the left table.
  • Neither table is modified.
ParameterTypeDefaultDescription
leftDataTable—The left DataTable (the main one).
rightDataTable—The right DataTable (the one that contributes columns).
onstring—Name of the common column to join on (must exist in both).
ParameterTypeDefaultDescription
typestring"inner"Join type: inner (only matched rows) · left (all rows from the left).

Returns a new DataTable with:

  1. all the columns of left, with their types;
  2. the columns of right except on (already on the left). If a right column has the same name as a left one, it appears as right_<name>.

If no row matches with inner, it returns a table with those columns and 0 rows.

MessageCause and fix
'left' must be a DataTable. / 'right' must be a DataTable.One of the tables does not evaluate to a DataTable.
'on' is required.The join column is missing.
Column '…' does not belong to table ….The on column does not exist in one of the tables (.NET message). Align the names with Rename Column.

Join sales with customer data on the CustomerId column and keep the sales with no registered customer:

Join DataTable left = sales right = customers on = "CustomerId" type = left → output: fullSales
Filter DataTable table = fullSales conditions: Name is-empty → output: noCustomer
Log message = rowCount(noCustomer) + " sales with no registered customer"