JSON Match Update
JSON Match Update matches records by key and backfills values from a lookup JSON into the matching source JSON records in real time, with a row-by-row preview of every change. The redesigned workbench has two tiers: the top tier takes both datasets side by side and auto-discovers nested arrays and fields, while the bottom tier holds the match condition and multiple field mappings, with a live result on the right.

- Paste the source JSON (to update) on the left and the lookup JSON (value source) on the right
- If arrays are nested or there are several, pick the one to process under Target array
- Click a suggested join key (e.g. id = card_id), or enter both match fields manually
- Pick a lookup value field → source write field under Update mappings; add more rules as needed
- Check the Match preview row by row, then copy or export the full JSON :::
Workbench at a glance
- Top tier: source JSON (to update) on the left and lookup JSON (value source) on the right, with a round swap button between them
- Bottom left: Match and update rules — 1. match condition, 2. update mappings, Advanced settings
- Bottom right: result area with a JSON / Match preview switch
- Each input: its own Format JSON, Upload and Clear all actions; the whole input card accepts dropped files
- Live results: there is no Start button — editing the data, the match keys or a mapping recalculates instantly
How to use
1. Input the source JSON
- The source JSON is the base data to update, placed in the top-left pane; paste it or drop a .json / .txt file
- It needs to contain an "object array" (an array whose elements are objects): the array may be at the top level or nested inside an object
- Invalid JSON shows "Source JSON is invalid. Please check syntax."; no object array shows "No object array was found in the source JSON. Provide an array of objects."
- A precision warning appears when integers beyond the safe range are detected, and a badge next to the title shows the selected array's item count (e.g. "3 items")
- If only one dataset is present, the right pane asks for the missing one and offers a "Try with sample data" button
2. Input the lookup JSON and pick the target array
- The lookup JSON is the value source, placed in the top-right pane; pasting and file drops work the same way, with the same validation messages
- When arrays are nested (for example
{"users": [...]}wrapped in an object) or a dataset contains several arrays, a Target array picker appears under the input listing every object-containing array path with its count, such as $.users (2); the selected array supplies the records to match - No picker appears when the top level is itself an array; the source and lookup selections are independent
- At any time the round "Swap source and lookup datasets" button exchanges both JSON texts, their selected target arrays and both match fields; update mappings are not swapped, so re-check rule directions afterwards
3. Set the match keys
- Under 1. Match condition (join keys) fill in the field used on each side; the layout reads "source match field = lookup match field", for example id and card_id
- When both datasets are valid but the keys are still empty, the right pane offers suggestions: each card shows "source field = lookup field" and "N shared keys"; clicking one fills both match fields and focuses the first incomplete update rule
- Suggestions are scored by overlapping values and prefer same-named and ID-like fields (id / uid / sku / code and so on); when no overlap is detected the right pane asks you to specify both fields manually
- Once set, a diagnostics strip updates live: "N / M matched", "Missing 'x' in source", "Missing 'y' in lookup", "0 matched (check both match fields)" or "N duplicate lookup keys"
4. Configure update mappings
- Under 2. Update mappings (Lookup ➔ Source) each rule is "lookup value field → source write field": read one field from the lookup record and write it into another field of the source record
- The direction is lookup → source: the left slot comes from the lookup JSON and the right slot from the source JSON, so do not fill them the other way round
- Clicking a lookup field chip fills the value field; when the source JSON has a same-named field the write field is paired automatically, otherwise click a source field chip
- Use Add update field to update several fields in one run; every rule is evaluated independently and reports its own status
- Rule statuses: Incomplete, Missing 'x' in lookup, No match, No change, N updated / N added; rules skipped by the write policy also show "N skipped"
- A sample record at the bottom of each card shows the match key, the write field and the previous → new value, with new fields tagged "New"
- Duplicate mapping and Delete mapping manage rules; Clear rules resets to a single empty rule
5. Review the result and match preview
- The result header shows "N updated" or "0 changes", plus "N unmatched"
- The JSON view holds the complete source dataset result with its outer wrapper preserved; Copy, Copy node and Export (json_match_update.json) are available
- Match preview lists every source record with its match key, field changes (write field previous → new) and status (Updated / Unmatched / Unchanged)
- The preview toolbar filters by Updated / Unmatched / Unchanged / All (a filter only appears when its count is above zero), and a search box appears when there are more than 5 rows
- When unmatched records exist, the JSON view shows a warning with a "View preview" button that jumps straight to them
- Result ➔ Source is enabled once at least one row was updated and writes the result back into the source JSON input
Two datasets and field roles
- Source JSON (to update): the dataset that is finally output; matched records get their write fields updated and unmatched records stay exactly as they were
- Lookup JSON (value source): a read-only lookup table; the tool reads values from the matching lookup records
- Swap: the round button exchanges both datasets, their target arrays and both match fields; update mapping rules are not swapped
- Field roles: chips of discovered fields are tagged with their role so the direction is obvious
- Source side: the match field is tagged "Match", written fields are tagged "Write", and a field that is both shows "Match/Write"
- Lookup side: the match field is tagged "Match", value fields are tagged "Read", and a field that is both shows "Match/Read"
- Chips also carry a value-type badge (Aa string / # number / T/F boolean / null /
{}object /[]array / * mixed) and coverage (number of records containing the field / total records); chips with partial coverage fade out - With more than 8 fields a filter box appears (filters by field name or sample); the first 8 are shown by default with Show all N fields / Show fewer
- Discovery scans up to the first 5,000 records and shows at most 150 fields per array; when the field limit is hit it says "Showing the first 150 fields"
Match keys, suggestions and write policy
Suggested join keys
- When both datasets are valid but the match keys are empty, up to 4 suggestions appear, ranked by overlap plus bonuses for same names and ID-like names (id / uid / sku / code and so on)
- The "N shared keys" badge is the number of distinct values present on both sides; clicking a card fills both match fields and focuses the first incomplete update rule
Key comparison
- Match keys are compared as strings: 12345 on the source and "12345" on the lookup are the same key, and booleans and numbers are converted to strings
- Empty strings, null, objects and arrays never participate; field names themselves are case-sensitive
- Exact match is the default; Ignore whitespace and case trims and lowercases both sides before comparing
Duplicate keys
- When the same match key appears several times in the lookup data, Keep last row is the default (the last row containing that value field), and it can be switched to Keep first row
- Lookup rows missing the value field, or whose match field is null or an empty string, are skipped
- The diagnostics strip reports "N duplicate lookup keys"
Write policy
Multi-field mappings
- Every update rule is independent: one source record can receive several fields at once
- Values are written as-is; numbers / strings / booleans / objects / arrays keep their types, and objects and arrays are deep-cloned
- Each run only processes the selected source and lookup arrays; the surrounding structure is output unchanged
Indentation
- Advanced settings offer 2 spaces (default), 4 spaces or Compact; this only affects the output format, not the data
- After changing any advanced option a Reset defaults button appears; when collapsed, the header summarizes the setup (e.g. "Overwrite · Exact · Last wins · 2 spaces")
Result views: JSON and match preview
JSON view
- The complete result is shown read-only with the outer wrapper preserved, plus character and line counts at the bottom
- When nothing was updated it says "No rows were updated (see the 'Match preview' view)." and offers View preview
- When some records did not match it says "N source rows did not match any lookup record (see the 'Match preview' view)." and offers View preview
- Copy copies the full result; Copy node strips the outer braces / brackets; Export saves json_match_update.json
Match preview
- Columns are: index, match key, field changes and status
- Each field change shows the write field, the previous value and the new value; newly added fields are tagged "New" and rows hit by the "失效" rule are tagged "Deprecated rule". Unmatched records have no field changes and show "—"
- Statuses: Updated / Unmatched / Unchanged; a missing match key is displayed as "—"
- The table previews at most 300 rows, while Copy and Export still include every record
- When the current filter has no rows, "No match" is shown
Field names and target arrays
- Match fields, lookup value fields and source write fields are all top-level key names of a record, such as id, card_id, count or weight; they are not JSONPath expressions and dots are not interpreted as nesting
- Only target arrays are paths: the top-level array is $, nested arrays appear as $.users or $.metrics, and they are chosen from the Target array picker rather than typed
- To match a field inside a nested object, either flatten the object beforehand or point at an array that contains that field
- Field names are case-sensitive; Ignore whitespace and case only affects the values of match keys, not field names
- When a lookup field has the same name as the source field you want to write, clicking the lookup chip pairs the write field automatically
Notes
:::warning Private-dataset rule: zh.title containing "失效" is forced to zero When a source record has zh.title containing "失效", the tool sets the write field of the first complete mapping to 0 before matching, taking precedence over the match result — even when no lookup record matched — and tags the row "Deprecated rule" in the preview. This rule is kept for a specific card/SKU dataset — clean up such titles beforehand if you do not want it.
- Both datasets need an object array: an array with at least one object; non-object elements are ignored. Without one the source pane says "No object array was found in the source JSON. Provide an array of objects." and the lookup pane says "No object array was found in the lookup JSON. Provide an array of objects."
- Unmatched records stay unchanged: source records with no lookup match are left untouched; only the selected arrays are processed and the surrounding structure is output as-is
- Missing match fields: if a dataset does not contain the configured match field at all, the diagnostics strip reports it and the matched count is 0
- Number precision: JSON numbers are parsed as floating point, so integers beyond the safe range (18-digit snowflake IDs, for example) may lose precision; the tool warns when it detects them. Store such IDs as strings when exactness matters
- Relaxed parsing: input is parsed JSON5-style (single quotes, unquoted keys and trailing commas are fine) and output is always standard JSON
- Performance: for large files use Upload or drag-and-drop; all matching runs locally in your browser and data is never uploaded
Pairing with other JSON tools
- Copy field values across paths (by path, not by ID) in the same record: JSON Field Value Mapper
- Prefix/suffix, find-replace or full-value overwrite in place: JSON Node Bulk Edit
- Add empty fields to the source before backfilling: JSON Node Bulk Insert
- Pull out the fields that will participate in matching: JSON Field Value Extractor

