Combine
Looks each row up in another table and adds the columns you pick.
@lainstack/data/combine · Data
How to use it
Section titled “How to use it”Use Combine to look each row of one table up in another and bring columns across. For example, give each invoice line the net and gross weight of its packing list line, matched on item code, or find the invoice lines whose item isn’t in the customer’s item list yet.
Good to know:
- Start with is the table you keep: every one of its rows ends up in the result. Look up in is the table each row is looked up in. Either can be a List of Records or a Table from an earlier step, as long as its columns are known.
- Match pairs a column of each table, up to three pairs. Rows match when every pair holds the same value. Text compares without letter case and outer spaces, numbers by value, and dates by day. A number matches text written the same way: 7 matches “7”, but not “007” or “7.0”. A row with an empty match value matches nothing.
- If several match decides what happens when one Start with row finds more than one row: Fail the step (the default) stops and names the item and rows, so nothing is picked silently. Use the first match takes the first in table order.
- Each Look up in row can be used is the other direction. Any number of times (the default) lets several Start with rows share one row, as invoice lines sharing an item code share its agreed code. Once stops the step when a row would be used twice, so an amount such as a weight is never counted twice.
- Add columns picks the Look up in columns to bring across. Leave it empty to bring every column except the match columns and any column Start with already has.
- Combined is every Start with row, in order, with the added columns; they are empty where a row found no match. No match is the Start with rows that found nothing. Both are Tables with a row count, so a Condition can check whether anything went unmatched.
Settings
Section titled “Settings”| Setting | Key | Type | Details |
|---|---|---|---|
| Start with (required) | startWith |
Value | The rows to keep, each looked up in the other table. |
| Look up in (required) | lookUpIn |
Value | The table each row is looked up in. |
| Match | match |
List | Rows match when every pair of columns holds the same value. At most 3 items. |
| If several match | ifSeveralMatch |
One of Fail the step, Use the first match |
|
| Each Look up in row can be used | eachUsed |
One of Any number of times, Once |
|
| Add columns | addColumns |
List | Leave empty to add every column of Look up in except the match columns and those Start with already has. At most 32 items. |
Outputs
Section titled “Outputs”| Output | Path | Type |
|---|---|---|
| Combined | combined |
Value |
| No match | noMatch |
Value |