Compare all key pairs with the same key for duplicate values, then process the record

I need to find and resolve duplicate asset records in some sort of meaningful way. My storyline goes like this:

Given an array of asset records, compare the key primary_serial for duplicate values.
Compare the entire record and copy the relevant differences to the oldest record of the duplicates. Delete the duplicate and report what it did.

I think this would be nearly the same as the “removeDuplicates” node, except it would have a way to get the data it removed out of the node so it can be assessed and merged into another record.

  • n8n version 1.7.1
  • Default database
  • Not sure how to get this infio: n8n EXECUTIONS_PROCESS setting (default: own, main):
  • n8n running in Docker on Digital Ocean.
  • Running on Ubuntu 22.04.3 LTS

Hi @russellkg, this is a tough one.

How do you identify the oldest record in your case? Do you have an example of the JSON data structure you’re working with?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.