HTTP node misses the JSON payload for 2nd iteration

Describe the issue/error/question

HTTP will not insert the JSON payload when iterating for the 2nd item returned from the previous node (Trello cardCreate)

The HTTP node is configured according to Trello’s REST API for custom fields here
For some unknown reason, when the time comes to iterate and put some custom field values for the 2nd card, the value of {{$node["clean data"].json["clientName"]}} will not reflect. A blank empty field is inserted.

image

What am I missing here?

Please share the workflow

Share the output returned by the last node

Summary
[
  {
    "id": "635035ffc29f66023bc09609",
    "badges": {
      "attachmentsByType": {
        "trello": {
          "board": 0,
          "card": 0
        }
      },
      "location": false,
      "votes": 0,
      "viewingMemberVoted": false,
      "subscribed": false,
      "fogbugz": "",
      "checkItems": 0,
      "checkItemsChecked": 0,
      "checkItemsEarliestDue": null,
      "comments": 0,
      "attachments": 0,
      "description": true,
      "due": "2021-05-01T00:00:00.000Z",
      "dueComplete": false,
      "start": null
    },
    "checkItemStates": [],
    "closed": false,
    "dueComplete": false,
    "dateLastActivity": "2022-10-19T17:38:07.276Z",
    "desc": "Lala Baba 1",
    "descData": {
      "emoji": {}
    },
    "due": "2021-05-01T00:00:00.000Z",
    "dueReminder": null,
    "email": null,
    "idBoard": "5c3b1441581d2a75ac80baf9",
    "idChecklists": [],
    "idList": "5c3b16b0cef89850076bd1cd",
    "idMembers": [],
    "idMembersVoted": [],
    "idShort": 3713,
    "idAttachmentCover": null,
    "labels": [],
    "idLabels": [],
    "manualCoverAttachment": false,
    "name": "Item 1",
    "pos": 16384,
    "shortLink": "q29bvgGt",
    "shortUrl": "https://trello.com/c/q29bvgGt",
    "start": null,
    "subscribed": false,
    "url": "https://trello.com/c/q29bvgGt/3713-item-1",
    "cover": {
      "idAttachment": null,
      "color": null,
      "idUploadedBackground": null,
      "size": "normal",
      "brightness": "dark",
      "idPlugin": null
    },
    "isTemplate": false,
    "cardRole": null,
    "attachments": [],
    "stickers": [],
    "limits": {}
  },
  {
    "id": "63503600d93fae04b873b10c",
    "badges": {
      "attachmentsByType": {
        "trello": {
          "board": 0,
          "card": 0
        }
      },
      "location": false,
      "votes": 0,
      "viewingMemberVoted": false,
      "subscribed": false,
      "fogbugz": "",
      "checkItems": 0,
      "checkItemsChecked": 0,
      "checkItemsEarliestDue": null,
      "comments": 0,
      "attachments": 0,
      "description": true,
      "due": "2021-05-01T00:00:00.000Z",
      "dueComplete": false,
      "start": null
    },
    "checkItemStates": [],
    "closed": false,
    "dueComplete": false,
    "dateLastActivity": "2022-10-19T17:38:08.124Z",
    "desc": "Nanababa",
    "descData": {
      "emoji": {}
    },
    "due": "2021-05-01T00:00:00.000Z",
    "dueReminder": null,
    "email": null,
    "idBoard": "5c3b1441581d2a75ac80baf9",
    "idChecklists": [],
    "idList": "5c3b16b0cef89850076bd1cd",
    "idMembers": [],
    "idMembersVoted": [],
    "idShort": 3714,
    "idAttachmentCover": null,
    "labels": [],
    "idLabels": [],
    "manualCoverAttachment": false,
    "name": "Item 2",
    "pos": 8192,
    "shortLink": "BKCkD3hU",
    "shortUrl": "https://trello.com/c/BKCkD3hU",
    "start": null,
    "subscribed": false,
    "url": "https://trello.com/c/BKCkD3hU/3714-item-2",
    "cover": {
      "idAttachment": null,
      "color": null,
      "idUploadedBackground": null,
      "size": "normal",
      "brightness": "dark",
      "idPlugin": null
    },
    "isTemplate": false,
    "cardRole": null,
    "attachments": [],
    "stickers": [],
    "limits": {}
  }
]

Information on your n8n setup

  • n8n version: 0.198.2
  • Database you’re using (default: SQLite): Postgres
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hi @physx911, seeing you have more than one item on your HTTP Request node but only one item on the clean data node you’re referencing in your expression will lead to the following behaviour:

  • For the first item arriving on the HTTP Request node, n8n will look up the first item on the clean data node which works fine
  • For the second item arriving on the HTTP Request node, n8n will look up the second item on the clean data node which doesn’t exist

So, what you most likely want here is have n8n always look up the first item from the clean data node. You could use an expression such as {{ $("clean data").first().json.clientName }} for this one ($(“<node-name>”).first() in our docs).

Let me know if you run into any trouble with this!

3 Likes