Join Datasets: Left Join, VLOOKUP by Key Column
Pricing
from $0.25 / 1,000 output rows
Join Datasets: Left Join, VLOOKUP by Key Column
Joins two tables on a key column: Apify datasets or CSV/JSON files by URL. Inner, left, right or full outer join, several keys, case and space tolerant matching, or VLOOKUP-style pulling of chosen columns. Empty input runs a free demo.
Pricing
from $0.25 / 1,000 output rows
Rating
0.0
(0)
Developer
Actor Factory
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Features
Share
Join two tables on a key column: left, inner, right or full outer join, or a VLOOKUP that pulls only the columns you pick.
You have two lists that share an ID: orders and customers, scraped products and your price list, leads and a blocklist. You want the customer's plan next to each order, or the rows that have no partner. In a spreadsheet that is a VLOOKUP; in a pipeline it is a join. This Actor does it for Apify datasets and CSV / TSV / JSON / NDJSON files from the Console form, with no code and no spreadsheet row limit.
- Cost: $0.35 per 1,000 output rows ($0.00035 per row). The $5 monthly free credit covers about 14,000 rows. The demo, failed runs and rows over your limit are free.
- Try it free: clear the four table fields and press Start. A small orders sample is joined to a customers sample (not charged, rows carry
_demo: true).
What you get
Left table: orders. Right table: customers. Joined on email with Ignore case and Trim spaces on, rightColumns: ["name", "city", "plan"], prefix customer_:
| order_id | item | amount | city | name | customer_city | plan | |
|---|---|---|---|---|---|---|---|
| A-1001 | aiko@example.com | Keyboard | 89 | Osaka | Aiko Tanaka | Kobe | pro |
| A-1002 | Ben@Example.com | Mouse | 25.5 | Leeds | Ben Carter | Leeds | free |
| A-1005 | zoe@example.com | Cable | 7.9 | Oslo | null | null | null |
- The left columns come first, unchanged. The right columns follow.
cityexists on both sides, so the right one is added ascustomer_city. Ben@Example.comfoundben@example.combecause spaces and case were ignored. The output keeps the original value.zoe@example.comhas no customer: with a left join the order stays, the right columns arenull.
Which tool is this?
| You want to... | Use |
|---|---|
| Add the columns of another table to your rows, matched by a key (this Actor) | Join Datasets |
| Stack several tables on top of each other with the same columns | Merge Datasets |
| Remove duplicate rows by the fields you choose | Remove Duplicates (Dataset Merge & Dedup) |
Merge Datasets and Remove Duplicates work vertically: more rows, same columns. Join Datasets works horizontally: the same rows (or the matching ones) with more columns.
What it does
- Four join types. Left (the default, what VLOOKUP does: no left row is lost), inner (only rows found in both), right, and full outer. Right and full outer also output the right rows no left row matched.
- VLOOKUP mode. Name the right columns to bring, in the order you want. Leave it empty to bring every right column except the key. Together with first match the output has exactly one row per left row.
- Several keys. Up to five key columns, matched by position:
["country", "year"]with["Country Code", "Year"]. Key columns may have different names on each side; nested fields work with dots (address.zip). - Forgiving matching. Trim spaces (on by default, also full-width spaces and line breaks) and Ignore upper/lower case (off by default). Numbers match their text form:
123,123.0and"123"are the same key, so a CSV file can be joined to a dataset. Leading zeros are kept:00123is not123. An empty key (null, empty text, spaces only) matches nothing. - The same key several times on the right. All (default) gives one output row per matching right row, like a database join. First or last keeps one right row per key.
- Column name clashes. A right column whose name already exists on the left gets your prefix (
citybecomesright_city); a second clash adds_2. You can also prefix every right column. - Match column. Turn on
_matchto getboth,left_onlyorright_onlyon every row, and filter the rows without a partner. - Big tables. The right table is held in memory as a lookup (up to 1,000,000 rows); the left table is streamed. Make the larger table the left one, and list only the right columns you need, so the default 1 GB of memory is enough for millions of left rows.
How to use
- Left table: pick a dataset, or paste a file URL. This is the table whose rows you keep.
- Right table: the lookup table, a dataset or a file URL.
- Left key columns (and Right key columns if the names differ).
- Choose the join type, the right columns to bring, and the matching options.
{"leftDatasetId": "WkzbQMuFYuamGv3YF","rightFileUrl": "https://example.com/customers.csv","leftKeys": ["email"],"rightKeys": ["Email Address"],"joinType": "left","rightColumns": ["name", "plan"],"multipleMatches": "first","ignoreCase": true}
Output
- Dataset: the joined rows, ready to download as CSV, Excel, JSON, XML or HTML. Values are copied unchanged: numbers, booleans and nested objects from datasets stay as they are, and CSV values stay text exactly as in the file.
- STATS record (key-value store): row counts of both tables, how many left rows found a partner and how many did not, right rows nobody matched, the keys, the output columns and how right columns were renamed, rows charged, and notes (for example rows with an empty key).
| field | meaning |
|---|---|
| left columns | every column of the left table, unchanged |
| right columns | the columns brought from the right table (renamed with the prefix when they clash) |
_match | both / left_only / right_only (only with Add a match column) |
_demo | true on the free demo rows |
Limits (cannot be raised by input)
- One left and one right table per run. Right table up to 1,000,000 rows; up to 1,000,000 output rows per run (the default Max output rows is 100,000); up to 5 key columns and 2,000 columns
- Files up to 100 MB each; JSON arrays up to 50 MB (use NDJSON for bigger files). Excel files are not read: save them as CSV first. Public links only (no login); addresses on internal networks are blocked
- A table that cannot be read (wrong dataset ID, HTTP error, broken JSON), or a key column that no row has, stops the run before anything is written or charged
- Set a maximum cost per run to cap spend: the run stops cleanly at that number of rows (status Succeeded), keeps what was joined and says so in the status message and STATS
Pricing
Pay per event: $0.00035 per output row ($0.35 per 1,000 rows). Input rows are free; you pay for the rows that are written. A key that repeats on both sides multiplies rows, so use first match for a lookup and keep Max output rows at a value you are happy to pay for. Failed runs, rows over the limit and the demo are not charged. Store discounts apply automatically: BRONZE −10%, SILVER −20%, GOLD −30%. On the Apify Free plan, the $5 of monthly platform credit covers about 14,000 rows a month.
FAQ
Is it the same as VLOOKUP? Yes for a left join with first match: every left row stays, and the columns you name are looked up in the right table. Unlike VLOOKUP the key does not have to be the first column, and you can match on several columns.
Why did my left rows multiply? The right table has the same key more than once and When the right table has the same key several times is on all. Choose first or last for a one-to-one lookup.
Why is nothing matched? Compare the key values in both tables: stray spaces, upper/lower case and leading zeros are the usual reasons. Turn on Trim spaces and Ignore case. With outer and the match column on you can see the unmatched rows from both sides.
Does it remove duplicates or stack tables? No. Use Remove Duplicates to drop duplicate rows, and Merge Datasets to put tables on top of each other.
Does it work with datasets from other Actors' runs? Yes, any dataset your account can read. Paste the defaultDatasetId of a run or the dataset URL from Apify Console.
More tools from the same developer
- Merge Datasets — combine several datasets or CSV/JSON files into one, with columns aligned
- Remove Duplicates — merge Apify datasets and remove duplicates by the fields you choose
- Filter CSV, JSON or Dataset Rows by Condition — keep only the rows of a CSV, JSON file or dataset that match simple conditions like country = US or price > 100
- Dataset Transform — flatten, filter, rename and convert any Apify dataset, export CSV / JSON / JSONL with a link
- CSV to Excel Converter — convert CSV, TSV, Excel XLSX, JSON and NDJSON files or Apify datasets into each other