naskio / n8n-nodes-updates

Split stream based on previous execution: new items, updated items, old items
https://www.npmjs.com/package/n8n-nodes-updates
MIT License
14 stars 1 forks source link

ERROR: 38182494 undefined is not unique. Please make sure that all items have unique 38182494. #2

Open wef0rm opened 1 year ago

wef0rm commented 1 year ago

I don't know what's going on here, so I hope you can make more sense of it.

I'm using your node to check for any new Harvest projects. The harvest node outputs all items as JSON, where all projects have their own unique ID.

In the updates node, it checks for {{ $json.id }} – and receives it, but I get the error below and the workflow halts.

ERROR: 38182494 undefined is not unique. Please make sure that all items have unique 38182494.

This is an example of the output it gets from the Harvest node with two new projects:

[
  {
    "id": 38182494,
    "name": "<name>",
    "code": "4973",
    "is_active": true,
    "is_billable": true,
    "is_fixed_fee": false,
    "bill_by": "Project",
    "budget": null,
    "budget_by": "none",
    "budget_is_monthly": false,
    "notify_when_over_budget": false,
    "over_budget_notification_percentage": 80,
    "show_budget_to_all": false,
    "created_at": "2023-08-30T08:02:12Z",
    "updated_at": "2023-08-30T08:02:12Z",
    "starts_on": null,
    "ends_on": null,
    "over_budget_notification_date": null,
    "notes": "",
    "cost_budget": null,
    "cost_budget_include_expenses": false,
    "hourly_rate": <redacted>,
    "fee": null,
    "client": {
      "id": 2324327,
      "name": "<name>",
      "currency": "NOK"
    }
  },
  {
    "id": 38182334,
    "name": "<name>",
    "code": "4972",
    "is_active": true,
    "is_billable": true,
    "is_fixed_fee": false,
    "bill_by": "Project",
    "budget": null,
    "budget_by": "none",
    "budget_is_monthly": false,
    "notify_when_over_budget": false,
    "over_budget_notification_percentage": 80,
    "show_budget_to_all": false,
    "created_at": "2023-08-30T07:38:36Z",
    "updated_at": "2023-08-30T07:38:36Z",
    "starts_on": null,
    "ends_on": null,
    "over_budget_notification_date": null,
    "notes": "",
    "cost_budget": null,
    "cost_budget_include_expenses": false,
    "hourly_rate": <redacted>,
    "fee": null,
    "client": {
      "id": 2324327,
      "name": "<name>",
      "currency": "NOK"
    }
  }
]

As you see the the id field is unique.

wef0rm commented 1 year ago

Could be I just figured it out, that you just use "id" as a "fixed" input, and not an expression.