Join DataTable
Join DataTable
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
left | DataTable | — | The left DataTable (the main one). |
right | DataTable | — | The right DataTable (the one that contributes columns). |
on | string | — | Name of the common column to join on (must exist in both). |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
type | string | "inner" | Join type: inner (only matched rows) · left (all rows from the left). |
Output
Section titled “Output”Returns a new DataTable with:
- all the columns of
left, with their types; - the columns of
rightexcepton(already on the left). If a right column has the same name as a left one, it appears asright_<name>.
If no row matches with inner, it returns a table with those columns and 0 rows.
Common errors
Section titled “Common errors”| Message | Cause 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. |
Example
Section titled “Example”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: noCustomerLog message = rowCount(noCustomer) + " sales with no registered customer"Related activities
Section titled “Related activities”- Rename Column — align the key column name.
- Filter DataTable — narrow down before or after joining.