# Compare records Source: https://neondeerdata.com/docs/platform/automations/steps/compare-records/ Step ยท Compare Compares two sets of records of one object: only in A, only in B, or in both. ## Inputs | Label | Key | Type | Required | Notes | | ------------- | ------------------ | ------- | -------- | -------------------------------------------------------------- | | Record object | `record_object` | Object | Yes | Variables cannot be wired. The sets appear after it is picked. | | Set A | `previous_records` | Records | No | | | Set B | `new_records` | Records | No | | ## Outputs | Label | Key | Type | Always set | Notes | | ----------- | ----------- | --------------------- | ---------- | ---------------------------------------------------------------- | | Only in B | `added` | Group: Count, Records | Yes | `added.count`, `added.records` (list of records) | | Only in A | `removed` | Group: Count, Records | Yes | `removed.count`, `removed.records` | | Differences | `changed` | Group: Count, Records | Yes | Items in A or B but not both. `changed.count`, `changed.records` | | In both | `unchanged` | Group: Count, Records | Yes | `unchanged.count`, `unchanged.records` | ## How it behaves - Set comparison on the record ID (lowercased). Duplicates count once; order is ignored. Always takes the single outcome. ## Errors Fails when - Neither Set A nor Set B is wired. Pick a Record object and wire at least one set. - No wired entry can be read as a record. The step fails rather than report no changes. - A wired record belongs to a different object than Record object. Wire records of that object, or change Record object to match. For errors that every step can return, see [Troubleshooting](https://neondeerdata.com/docs/platform/automations/troubleshooting/). ## Example Find which people were linked to or unlinked from a deal, comparing the list before and after an update. **Example inputs** | Input | Value | | ------------- | --------------------- | | Record object | People | | Set A | Priya Shah, Tom Reyes | | Set B | Priya Shah, Lena Park | **Example outputs** | Output | Value | | ----------- | ----------------------------- | | Only in B | Count 1: Lena Park | | Only in A | Count 1: Tom Reyes | | Differences | Count 2: Tom Reyes, Lena Park | | In both | Count 1: Priya Shah | A record from another object in either set fails the step.