Finding duplicates

Trying to find duplicates based on the “ACR” field in the following (sample) json:

{
  "id": "rec00eGaEyujHoEdP",
  "createdTime": "2022-07-27T16:42:20.000Z",
  "fields": {
    "call_id": 1321,
    "message": "msg 1",
    "date": "2021-06-15T08:55:00.000Z",
    "ACR#": "ACR# 107844",
    "Month": 6,
    "Year": 2021,
    "Last modified": "2022-07-27T16:42:20.000Z"
  }
},
{
  "id": "rec00eGaEyujHoEdP",
  "createdTime": "2022-07-27T16:42:20.000Z",
  "fields": {
    "call_id": 1321,
    "message": "msg 2",
    "date": "2021-06-15T08:55:00.000Z",
    "ACR#": "ACR# 107844",
    "Month": 6,
    "Year": 2021,
    "Last modified": "2022-07-27T16:42:20.000Z"
  }
},
{
  "id": "rec04en1Ufh3mKrkG",
  "createdTime": "2022-07-27T16:42:15.000Z",
  "fields": {
    "call_id": 1048,
    "message": "msg 3",
    "date": "2022-02-22T15:20:00.000Z",
    "ACR#": "ACR# 107844",
    "Month": 2,
    "Year": 2022,
    "Last modified": "2022-07-27T16:42:15.000Z"
  }
}

I tried using ItemList, but that didn’t work since it isn’t an array. The new Code function is killing me, because every I example I find when searching seems to only work in the old Function node…

Any suggestions what to try - would be massively appreciated!

Hi @Tzvi_S, I am not sure I fully understand your data structure but assuming these are n8n items the Item Lists node should work fine for deduplication based on a nested field. You’d only need to specify the full path to your ACR# field, like so:

This is the result:

That’s very helpful, thank you!

1 Like

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