# VLOOKUP for Datasets: Join & Match Two Tables (`data-done-right/dataset-join-vlookup`) Actor

VLOOKUP for datasets: join two tables on one or more key columns (left, inner, right, full, anti, semi). Fixes case, spaces, accents and 001 vs 1. Optional fuzzy match, match report of unmatched keys, CSV/XLSX/JSON export. Input: Apify datasets, CSV/JSON/XLSX URLs or pasted rows.

- **URL**: https://apify.com/data-done-right/dataset-join-vlookup.md
- **Developed by:** [Data Done Right](https://apify.com/data-done-right) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.44 / 1,000 row joineds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## VLOOKUP for Datasets: Join & Match Two Tables

**VLOOKUP for datasets**: this Actor joins two tables (Apify datasets, CSV, JSON or XLSX files, or pasted rows) on one or more key columns, and cleans the keys first so the usual `#N/A` causes (trailing spaces, upper/lower case, `001` vs `1`) simply match.

What you get:

- A joined table in the dataset, in the order of your left table, with an optional `_match_status` column (`matched`, `fuzzy`, `unmatched`, `right_only`).
- A match report in the key-value store: matched and unmatched counts, the list of keys that found no match, and a hint when a wider cleaning step would have matched them.
- Optional CSV, XLSX or JSON files with download links.

What it does not do: it is not a database. The right (lookup) table is loaded fully into memory. It does not call an LLM, it does not scrape anything, and fuzzy matches are guesses that you should review. Only left and right tables you give it are read.

Join types: left (the VLOOKUP default), inner, right, full outer, anti-join (left rows with no match) and semi-join (left rows that have a match).

### How to do a VLOOKUP on two datasets

1. Put your table in **Left table** (a dataset, a file URL, or pasted rows). This is the table you keep.
2. Put the lookup table in **Right table**.
3. Set **Left key column(s)** (for example `email`). If the right table names it differently, set **Right key column(s)** too.
4. Leave **Join type** on `left`. Run. Each left row gets the right columns, or empty values and `_match_status = unmatched`.

### How to join two datasets on a key

Use the same steps and pick the join type: `inner` drops rows without a match, `full` keeps everything from both tables. Composite keys work: `["first_name", "last_name"]` matches on both columns, by position with the right keys.

### How to match two lists and find what is missing

Choose `anti` to get the left rows that are NOT in the right table (new leads not yet in the CRM), or `semi` for the left rows that are. Both return only left columns.

### How to left join CSV files

Set **Left table: file URL** and **Right table: file URL** to direct links to `.csv`, `.tsv`, `.json`, `.jsonl` or `.xlsx` files (Excel: pick a sheet in the sheet field; old `.xls` is not supported, save as `.xlsx`). Add `"exports": ["csv"]` to get the result as a CSV link.

### Why my VLOOKUP returned #N/A

Excel compares keys exactly, character by character. These are the usual causes, and what this Actor does about each:

| Cause | Example | Handled by |
|---|---|---|
| Trailing or double spaces, non-breaking spaces | `"ACME "` vs `"ACME"` | Trim spaces (on by default) |
| Different case | `ANA@X.COM` vs `ana@x.com` | Ignore case (on by default) |
| Number stored as text, or leading zeros | `001` vs `1`, `4.0` vs `4` | Numbers and IDs as numbers (on by default) |
| Accents | `Café` vs `Cafe` | Ignore accents (off by default) |
| Punctuation | `Acme, Inc.` vs `Acme Inc` | Ignore punctuation (off by default) |
| Spaces inside codes | `AB 123` vs `AB123` | Remove all spaces (off by default) |
| Key is not in the lookup table | genuinely missing | Reported in `UNMATCHED_KEYS` |
| Typos | `Microsft` vs `Microsoft` | Optional fuzzy matching |
| Duplicate keys in the lookup table | two rows for one key | VLOOKUP silently takes the first; choose first, last, all or error |

Your output keeps the original values; normalising only affects the comparison. Caveat: the numeric step treats `00123` and `123` as the same key. Turn it off, or set per-key steps with `keyNormalizers`, if leading zeros are meaningful in your IDs. Rows whose key cell is empty never match.

### Input example (copy and paste)

```json
{
  "leftItems": [
    {"order_id": 1001, "email": "Ana.Lopez@Example.com ", "amount": 120.5},
    {"order_id": 1002, "email": " ben@example.com", "amount": 75},
    {"order_id": 1003, "email": "CARLA@EXAMPLE.COM", "amount": 42.99},
    {"order_id": 1004, "email": "dev@example.com", "amount": 300},
    {"order_id": 1005, "email": "zoe@other.org", "amount": 18}
  ],
  "rightItems": [
    {"email": "ana.lopez@example.com", "name": "Ana Lopez", "plan": "pro"},
    {"email": "ben@example.com", "name": "Ben Jones", "plan": "free"},
    {"email": "carla@example.com", "name": "Carla Diaz", "plan": "pro"},
    {"email": "dev@example.com ", "name": "Dev Patel", "plan": "team"},
    {"email": "eve@example.com", "name": "Eve Chen", "plan": "free"}
  ],
  "leftKeys": ["email"]
}
```

### Output example (from a real local run of the input above)

First row of the dataset:

```json
{"order_id": 1001, "email": "Ana.Lopez@Example.com ", "amount": 120.5, "name": "Ana Lopez", "plan": "pro", "_match_status": "matched"}
```

The last row (`zoe@other.org` is not in the CRM) has `"name": null, "plan": null, "_match_status": "unmatched"`. Four of five rows matched. The `MATCH_REPORT` record shows `matchedLeftRows: 4`, `unmatchedLeftRows: 1`, `unmatchedRightRows: 1` and the unmatched key list.

### Three worked examples (real local runs)

#### 1. VLOOKUP prices by SKU (001 vs 1)

Left sales lines have SKUs `"1"`, `" 002 "`, `3`, `"4.0"`, `"7"`; the price list has `001` to `004`. Input: `leftKeys: ["sku"]`, `rightColumns: ["product", "price"]`.

```json
{"line": 1, "sku": "1", "qty": 2, "product": "Widget", "price": 9.5, "_match_status": "matched"}
{"line": 2, "sku": " 002 ", "qty": 1, "product": "Gadget", "price": 12, "_match_status": "matched"}
{"line": 3, "sku": 3, "qty": 5, "product": "Gizmo", "price": 3.25, "_match_status": "matched"}
{"line": 4, "sku": "4.0", "qty": 1, "product": "Doohickey", "price": 40, "_match_status": "matched"}
{"line": 5, "sku": "7", "qty": 9, "product": null, "price": null, "_match_status": "unmatched"}
```

Four matched, one unmatched (SKU 7 is really not in the list).

#### 2. Leads that are not in your CRM (anti-join)

Input: `leftKeys: ["company"]`, `joinType: "anti"`, `normAccents: true`, `normPunctuation: true`. `Café Noir, Inc.`, `ACME Corp.` and `Beta  Labs` match the CRM entries `cafe noir inc`, `Acme Corp` and `Beta Labs`, so only two leads are returned:

```json
{"company": "Nuevo Sol S.A.", "contact": "ana@nuevosol.example", "_match_status": "unmatched"}
{"company": "Gamma GmbH", "contact": "jo@gamma.example", "_match_status": "unmatched"}
```

#### 3. Reconcile invoices with a vendor list (full join with fuzzy matching)

Input: `leftKeys: ["supplier"]`, `rightKeys: ["vendor"]`, `joinType: "full"`, `fuzzyMatch: true`, `fuzzyThreshold: 0.88`.

```json
{"invoice": "INV-1", "supplier": "Microsft Corporation", "total": 1200, "vendor_id": "V100", "approved": true, "_match_status": "fuzzy", "_fuzzy_score": 0.9305}
{"invoice": "INV-2", "supplier": "Amazon Web Servces", "total": 560.4, "vendor_id": "V200", "approved": true, "_match_status": "fuzzy", "_fuzzy_score": 0.9895}
{"invoice": "INV-3", "supplier": "Googel LLC", "total": 89, "vendor_id": "V300", "approved": true, "_match_status": "fuzzy", "_fuzzy_score": 0.98}
{"invoice": "INV-4", "supplier": "Stripe Inc", "total": 310, "vendor_id": "V400", "approved": false, "_match_status": "matched", "_fuzzy_score": null}
{"invoice": "INV-5", "supplier": "Zenith Tools", "total": 45, "vendor_id": null, "approved": null, "_match_status": "unmatched", "_fuzzy_score": null}
{"invoice": null, "supplier": "Acme Holdings", "total": null, "vendor_id": "V500", "approved": true, "_match_status": "right_only", "_fuzzy_score": null}
```

`Stripe Inc` matched exactly; three rows matched by similarity and carry a score. Review those before trusting them.

### Inputs

| Field | Default | What it does |
|---|---|---|
| `leftDatasetId`, `leftUrl`, `leftItems`, `leftText`, `leftSheet` | none | Left table sources (combined in this order if you give several). `leftSheet` picks an Excel sheet. |
| `rightDatasetId`, `rightUrl`, `rightItems`, `rightText`, `rightSheet` | none | Right (lookup) table sources. |
| `leftKeys` (required) | none | Key column(s) of the left table. Dotted paths work. |
| `rightKeys` | same as left | Key column(s) of the right table, matched by position. |
| `joinType` | `left` | `left`, `inner`, `right`, `full`, `anti`, `semi`. |
| `duplicateMatches` | `first` | When a right key repeats: `first`, `last`, `all` (one output row per match), `error` (stop before charging). |
| `normTrim` / `normCase` / `normNumeric` | true | Key cleaning on by default. |
| `normAccents` / `normPunctuation` / `normRemoveSpaces` | false | Extra key cleaning. |
| `keyNormalizers` | none | Per-key override, e.g. `{"sku": ["trim","case","numeric"]}`. |
| `rightColumns` | all but keys | Right columns to bring over. |
| `rightPrefix`, `rightSuffix` | empty | Added to every right column name. |
| `collisionSuffix` | `_right` | Added when a right column name already exists on the left. |
| `keepRightKeys` | false | Also output the right key columns. |
| `addMatchStatus` | true | Adds `_match_status`. |
| `fuzzyMatch` | false | Fuzzy pass for unmatched rows. |
| `fuzzyThreshold` | 0.88 | Minimum similarity, 0.5 to 1. |
| `fuzzyMethod` | `jaro-winkler` | Or `difflib`. |
| `fuzzyMaxComparisons` | 4,000,000 | Work limit; above it fuzzy is skipped and the report says so. |
| `exports` | none | Any of `csv`, `xlsx`, `json`, `jsonl`. |
| `exportName` | `joined` | Base file name. |
| `escapeFormulas` | true | Neutralises `=`/`+`/`-`/`@` cells in CSV exports. |
| `maxLeftRows` | 100,000 | Cap on left rows read (and on cost). |
| `maxRightRows` | 500,000 | Cap on right rows loaded. |
| `maxOutputRows` | 1,000,000 | Cap on rows written. |
| `maxFileSizeMb` | 50 | Largest downloaded file. |
| `csvInferTypes` | true | CSV `12` becomes a number; `007` stays text. |

### Fuzzy matching: how it works

Exact matching (with your cleaning steps) always runs first. Only the left rows that found no match are then compared with right rows that nobody matched, using Jaro-Winkler (default) or difflib. Matches are one-to-one and best score first. With several key columns, every column must reach the threshold. Fuzzy matches are labelled `fuzzy` with a `_fuzzy_score`. It is pure Python, so the work is limited: roughly 2 million comparisons take about 12 seconds (measured locally on short random strings). Fuzzy mode keeps the left table in memory.

### The match report

Written to the key-value store after each run:

- `MATCH_REPORT`: counts (left rows, matched exact and fuzzy, unmatched left, unmatched right), duplicate right keys, billing counts, per-source status and errors, warnings, and the first 100 unmatched keys. Each hint is one of: `wouldMatch` (this right key matches if you turn on the listed cleaning steps), or `similarRightKey` (a similar key, 0.9+ similarity, only a hint).
- `UNMATCHED_KEYS`: up to 10,000 unmatched left keys and 10,000 right keys that nobody used.

### How much does it cost

Pay per event: **$0.0018 per left row processed** (`row-joined`, $1.80 per 1,000), plus **$0.002 per fuzzy match** (`fuzzy-row-matched`, only when fuzzy matching is on and finds one), plus **$0.004 per export file** (`export-file`). The right table is free to load. Rows are charged on the left table whether or not they match, and `duplicateMatches = all` does not raise the price. In right and full joins, each right-only row written is also charged as a `row-joined` event, because it is an output row.

| Job | Cost |
|---|---|
| 1,000 left rows | $1.80 |
| 10,000 left rows + CSV export | $18.004 |
| 100,000 left rows, 5,000 fuzzy matches, CSV and XLSX | $180 + $10 + $0.008 = $190.008 |

The input fields `maxLeftRows` and your run's spending limit cap the cost. If the spending limit is reached the run stops with the rows done so far.

### Use cases

- Add prices, names or owners from a lookup sheet to an export, like VLOOKUP, without `#N/A`.
- Find leads, products or contacts that are not yet in another list (anti-join).
- Reconcile invoices, payments and a vendor master, with a review score on fuzzy matches.
- Join the datasets of two scraper runs on a URL or ID column.
- Check which keys fail to match and why, using the match report.

### FAQ

**How is this different from Merge Datasets?** Merge stacks tables on top of each other. This joins them side by side on a key.

**Does it change my key values?** No. Cleaning is only used for comparing. Output keeps your original text.

**What if the lookup table has the same key twice?** `first` (default) copies VLOOKUP, `last` takes the last, `all` returns one row per match, `error` stops before any charge and lists the duplicate keys.

**Is fuzzy matching accurate?** It is a similarity guess. Short names and keys that share long prefixes (for example email addresses on one domain) can score high without being the same. Raise the threshold and review `_fuzzy_score`.

**How big can the tables be?** The right table is held in memory (default cap 500,000 rows; memory use was not load-tested beyond 100,000 rows). The left table streams unless fuzzy matching is on. Excel files are limited to the first sheet you pick; `.xls` is not supported. Google Sheets must be a published CSV link.

**What does it not do?** No many-to-many aggregation, no computed columns, no SQL, no approximate numeric ranges (the Excel TRUE mode of VLOOKUP), and it cannot read private files that need a login.

### Use with the Apify API, MCP, n8n or Make

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("<username>/dataset-join-vlookup").call(run_input={
    "leftDatasetId": "LEFT_DATASET_ID", "rightUrl": "https://example.com/prices.csv",
    "leftKeys": ["sku"], "joinType": "left", "exports": ["csv"]})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row)
report = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("MATCH_REPORT")["value"]
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('<username>/dataset-join-vlookup').call({
  leftItems: [{ sku: '1' }], rightItems: [{ sku: '001', price: 9.5 }], leftKeys: ['sku'] });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

The input is small and every field is described, so it also works as an MCP tool call from an agent, and in n8n or Make through the Apify nodes (run the Actor, then read the dataset).

### Related tools

- **Merge Datasets & Dedupe: Combine, Filter, Export CSV & Excel**: stack several datasets or files into one.
- **Remove Duplicates: Deduplicate Datasets, CSV & Excel**: clean a table before joining it.
- **Excel to JSON Converter: XLSX, XLS & CSV to JSON API**: turn spreadsheets into rows first.

# Actor input Schema

## `leftDatasetId` (type: `string`):

Pick the Apify dataset that is the table you want to keep and add columns to (the one with the VLOOKUP formulas), or paste its ID (example: aBcD1234eFgH5678i or username~my-dataset). Leave empty if you use a URL or pasted rows.

## `leftUrl` (type: `string`):

Direct link to a .csv, .tsv, .json, .jsonl or .xlsx file (example: https://example.com/export/customers.csv). Google Sheets: use the 'publish to web' CSV link. Private networks are blocked.

## `leftItems` (type: `array`):

Rows pasted as a JSON array of objects (example: \[{"sku": "001", "price": 9.5}]). Good for small tables and for trying the Actor. Combined with the other left sources in the order dataset, URL, rows, text.

## `leftText` (type: `string`):

CSV text with a header row, or JSON/JSON Lines text (example: "sku,price\n001,9.5\n002,12"). The format is detected automatically.

## `leftSheet` (type: `string`):

Sheet name or number (1 = first) to read when the file is .xlsx (example: Sheet2). Empty = first sheet.

## `rightDatasetId` (type: `string`):

Pick the Apify dataset that is the lookup table (the one you look values up in), or paste its ID (example: aBcD1234eFgH5678i or username~my-dataset). Leave empty if you use a URL or pasted rows.

## `rightUrl` (type: `string`):

Direct link to a .csv, .tsv, .json, .jsonl or .xlsx file (example: https://example.com/export/customers.csv). Google Sheets: use the 'publish to web' CSV link. Private networks are blocked.

## `rightItems` (type: `array`):

Rows pasted as a JSON array of objects (example: \[{"sku": "001", "price": 9.5}]). Good for small tables and for trying the Actor. Combined with the other right sources in the order dataset, URL, rows, text.

## `rightText` (type: `string`):

CSV text with a header row, or JSON/JSON Lines text (example: "sku,price\n001,9.5\n002,12"). The format is detected automatically.

## `rightSheet` (type: `string`):

Sheet name or number (1 = first) to read when the file is .xlsx (example: Sheet2). Empty = first sheet.

## `leftKeys` (type: `array`):

Column(s) of the left table to match on. One name for a single key, several for a composite key. Dotted paths work for nested data. Example: \["email"] or \["first_name", "last_name"].

## `rightKeys` (type: `array`):

Column(s) of the right table, matched to the left keys by position. Leave empty when the names are the same. Example: \["customer_email"].

## `joinType` (type: `string`):

left keeps all left rows and adds right columns where a match exists (what VLOOKUP does). anti returns left rows that have no match, semi returns left rows that do.

## `duplicateMatches` (type: `string`):

first behaves like VLOOKUP. all repeats the left row once per match (output can grow, the price does not). error stops the run before anything is charged and lists the duplicate keys.

## `normTrim` (type: `boolean`):

Strip leading, trailing and non-breaking spaces and collapse inner runs of whitespace. " ACME  Corp " = "ACME Corp".

## `normCase` (type: `boolean`):

Compare in lower case. "ANA@X.COM" = "ana@x.com".

## `normAccents` (type: `boolean`):

Remove accents before comparing. "Café" = "Cafe".

## `normNumeric` (type: `boolean`):

Treat number-like keys as numbers: "001" = 1 = "1.0", and "1,000" is 1000. Text that is not wholly a number is untouched.

## `normPunctuation` (type: `boolean`):

Drop punctuation and symbols. "Acme, Inc." = "Acme Inc".

## `normRemoveSpaces` (type: `boolean`):

Delete every space inside the key. "AB 123" = "AB123". Useful for phone and part numbers.

## `keyNormalizers` (type: `object`):

Optional. Overrides the switches above for named left key columns. Allowed steps: trim, case, accents, numeric, punctuation, remove_spaces. Example: {"sku": \["trim", "case", "numeric"], "city": \["trim", "case", "accents"]}.

## `rightColumns` (type: `array`):

Which right-table columns to bring over. Empty = all except the key columns. Example: \["name", "plan"].

## `rightPrefix` (type: `string`):

Text put before every right column name (example: crm\_). Empty = none.

## `rightSuffix` (type: `string`):

Text put after every right column name (example: \_crm). Empty = none.

## `collisionSuffix` (type: `string`):

Added to a right column whose name already exists on the left (example: \_right gives name_right).

## `keepRightKeys` (type: `boolean`):

Also output the right table's key columns. By default they are dropped because they repeat the left keys.

## `addMatchStatus` (type: `boolean`):

Adds \_match_status to each row: matched, fuzzy, unmatched or right_only. Turn off for a clean table.

## `fuzzyMatch` (type: `boolean`):

After the exact join, try to pair left rows that found no match with unused right rows by similar keys (typos, small spelling differences). Approximate and one-to-one. Each fuzzy match is billed extra. Holds the left table in memory.

## `fuzzyThreshold` (type: `number`):

Minimum similarity from 0.5 to 1 (example: 0.88). Higher = fewer, safer matches. With several key columns every column must reach it.

## `fuzzyMethod` (type: `string`):

Similarity measure. Jaro-Winkler favours matching starts of words; difflib compares longest common blocks.

## `fuzzyMaxComparisons` (type: `integer`):

Largest number of key comparisons (unmatched left keys x unused right keys) to allow. Above it, fuzzy matching is skipped and the report says so. Example: 4000000.

## `exports` (type: `array`):

Also write the joined table as files in the key-value store, with links in MATCH_REPORT. Each file is billed once. Leave empty for the dataset only.

## `exportName` (type: `string`):

Base name of the export files (example: orders-with-customers).

## `escapeFormulas` (type: `boolean`):

Prefix text cells that start with = + - or @ with an apostrophe in CSV exports so Excel cannot run them. XLSX cells are always stored as text.

## `maxLeftRows` (type: `integer`):

Hard cap on left rows read, and therefore on cost (example: 100000 rows = at most $180). Reading stops there and the run still succeeds.

## `maxRightRows` (type: `integer`):

Hard cap on right rows loaded into memory (example: 500000). Rows beyond it cannot match, and the report warns you.

## `maxOutputRows` (type: `integer`):

Stops writing rows after this many (matters for duplicateMatches = all). Example: 1000000.

## `maxFileSizeMb` (type: `integer`):

Largest CSV/JSON/XLSX file to download per URL, in megabytes (example: 50).

## `csvInferTypes` (type: `boolean`):

Turns CSV cells like 12 or 3.5 into numbers. Text such as 007 or +1555 stays text, and key matching ignores the difference anyway.

## Actor input object example

```json
{
  "leftItems": [
    {
      "order_id": 1001,
      "email": "Ana.Lopez@Example.com ",
      "amount": 120.5
    },
    {
      "order_id": 1002,
      "email": " ben@example.com",
      "amount": 75
    },
    {
      "order_id": 1003,
      "email": "CARLA@EXAMPLE.COM",
      "amount": 42.99
    },
    {
      "order_id": 1004,
      "email": "dev@example.com",
      "amount": 300
    },
    {
      "order_id": 1005,
      "email": "zoe@other.org",
      "amount": 18
    }
  ],
  "rightItems": [
    {
      "email": "ana.lopez@example.com",
      "name": "Ana Lopez",
      "plan": "pro"
    },
    {
      "email": "ben@example.com",
      "name": "Ben Jones",
      "plan": "free"
    },
    {
      "email": "carla@example.com",
      "name": "Carla Diaz",
      "plan": "pro"
    },
    {
      "email": "dev@example.com ",
      "name": "Dev Patel",
      "plan": "team"
    },
    {
      "email": "eve@example.com",
      "name": "Eve Chen",
      "plan": "free"
    }
  ],
  "leftKeys": [
    "email"
  ],
  "joinType": "left",
  "duplicateMatches": "first",
  "normTrim": true,
  "normCase": true,
  "normAccents": false,
  "normNumeric": true,
  "normPunctuation": false,
  "normRemoveSpaces": false,
  "collisionSuffix": "_right",
  "keepRightKeys": false,
  "addMatchStatus": true,
  "fuzzyMatch": false,
  "fuzzyThreshold": 0.88,
  "fuzzyMethod": "jaro-winkler",
  "fuzzyMaxComparisons": 4000000,
  "exports": [],
  "exportName": "joined",
  "escapeFormulas": true,
  "maxLeftRows": 100000,
  "maxRightRows": 500000,
  "maxOutputRows": 1000000,
  "maxFileSizeMb": 50,
  "csvInferTypes": true
}
```

# Actor output Schema

## `results` (type: `string`):

The joined table (all result items of this run, as JSON, CSV, Excel and more).

## `records` (type: `string`):

Key-value store records: MATCH_REPORT (matched and unmatched counts, billing counts, per-source status), UNMATCHED_KEYS (keys that found no match, with hints) and any CSV, XLSX or JSON export files.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "leftItems": [
        {
            "order_id": 1001,
            "email": "Ana.Lopez@Example.com ",
            "amount": 120.5
        },
        {
            "order_id": 1002,
            "email": " ben@example.com",
            "amount": 75
        },
        {
            "order_id": 1003,
            "email": "CARLA@EXAMPLE.COM",
            "amount": 42.99
        },
        {
            "order_id": 1004,
            "email": "dev@example.com",
            "amount": 300
        },
        {
            "order_id": 1005,
            "email": "zoe@other.org",
            "amount": 18
        }
    ],
    "rightItems": [
        {
            "email": "ana.lopez@example.com",
            "name": "Ana Lopez",
            "plan": "pro"
        },
        {
            "email": "ben@example.com",
            "name": "Ben Jones",
            "plan": "free"
        },
        {
            "email": "carla@example.com",
            "name": "Carla Diaz",
            "plan": "pro"
        },
        {
            "email": "dev@example.com ",
            "name": "Dev Patel",
            "plan": "team"
        },
        {
            "email": "eve@example.com",
            "name": "Eve Chen",
            "plan": "free"
        }
    ],
    "leftKeys": [
        "email"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-done-right/dataset-join-vlookup").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "leftItems": [
        {
            "order_id": 1001,
            "email": "Ana.Lopez@Example.com ",
            "amount": 120.5,
        },
        {
            "order_id": 1002,
            "email": " ben@example.com",
            "amount": 75,
        },
        {
            "order_id": 1003,
            "email": "CARLA@EXAMPLE.COM",
            "amount": 42.99,
        },
        {
            "order_id": 1004,
            "email": "dev@example.com",
            "amount": 300,
        },
        {
            "order_id": 1005,
            "email": "zoe@other.org",
            "amount": 18,
        },
    ],
    "rightItems": [
        {
            "email": "ana.lopez@example.com",
            "name": "Ana Lopez",
            "plan": "pro",
        },
        {
            "email": "ben@example.com",
            "name": "Ben Jones",
            "plan": "free",
        },
        {
            "email": "carla@example.com",
            "name": "Carla Diaz",
            "plan": "pro",
        },
        {
            "email": "dev@example.com ",
            "name": "Dev Patel",
            "plan": "team",
        },
        {
            "email": "eve@example.com",
            "name": "Eve Chen",
            "plan": "free",
        },
    ],
    "leftKeys": ["email"],
}

# Run the Actor and wait for it to finish
run = client.actor("data-done-right/dataset-join-vlookup").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "leftItems": [
    {
      "order_id": 1001,
      "email": "Ana.Lopez@Example.com ",
      "amount": 120.5
    },
    {
      "order_id": 1002,
      "email": " ben@example.com",
      "amount": 75
    },
    {
      "order_id": 1003,
      "email": "CARLA@EXAMPLE.COM",
      "amount": 42.99
    },
    {
      "order_id": 1004,
      "email": "dev@example.com",
      "amount": 300
    },
    {
      "order_id": 1005,
      "email": "zoe@other.org",
      "amount": 18
    }
  ],
  "rightItems": [
    {
      "email": "ana.lopez@example.com",
      "name": "Ana Lopez",
      "plan": "pro"
    },
    {
      "email": "ben@example.com",
      "name": "Ben Jones",
      "plan": "free"
    },
    {
      "email": "carla@example.com",
      "name": "Carla Diaz",
      "plan": "pro"
    },
    {
      "email": "dev@example.com ",
      "name": "Dev Patel",
      "plan": "team"
    },
    {
      "email": "eve@example.com",
      "name": "Eve Chen",
      "plan": "free"
    }
  ],
  "leftKeys": [
    "email"
  ]
}' |
apify call data-done-right/dataset-join-vlookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-done-right/dataset-join-vlookup"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/LOWpoBReTqruWeDdg/builds/uaIy84h56uJehGRnR/openapi.json
