Back to Templates

Compare Lists and Identify Common Items & Differences Using Custom Keys

Created by

Created by: Tenkay || tenkay

Tenkay

Last update

Last update a day ago

Categories

Share


This workflow compares two lists of objects (List A and List B) using a user-specified key (e.g. email, id, domain) and returns:

  • Items common to both lists (based on the key)
  • Items only in List A
  • Items only in List B

How it works:

  1. Accepts a JSON input containing:
    • listA: the first list of items
    • listB: the second list of items
    • key: the field name to use for comparison
  2. Performs a field-based comparison using the specified key
  3. Returns a structured output:
    • common: items with matching keys (only one version retained)
    • onlyInA: items found only in List A
    • onlyInB: items found only in List B

Example Input:

{
  "key": "email",
  "listA": [
    { "email": "[email protected]", "name": "Alice" },
    { "email": "[email protected]", "name": "Bob" }
  ],
  "listB": [
    { "email": "[email protected]", "name": "Bobby" },
    { "email": "[email protected]", "name": "Carol" }
  ]
}

Output:

Use Cases:

  • Deduplicate data between two sources
  • Find overlapping records
  • Identify new or missing entries across systems

This workflow is useful for internal data auditing, list reconciliation, transaction reconciliation, or pre-processing sync jobs.