Data is not iterated through

Describe the issue/error/question

I want to create a simple workflow that goes through all the items received from a webhook.
But my workflow just runs the SearchbyColumn node once and not for all data.
To be seen in the screenshot:


Does any one have an idea why?

Please share the workflow

Share the output returned by the last node

Input:

[
  {
    "0": "11",
    "1": "1604x1596",
    "2": "van",
    "3": "bicycle",
    "4": "5.66",
    "5": "1662972813266",
    "6": "30.72"
  },
  {
    "0": "10",
    "1": "1560x1532",
    "2": "car",
    "3": "pedestrian",
    "4": "30.03",
    "5": "1662972720233",
    "6": "5.66"
  },
  {
    "0": "9",
    "1": "1534x1532",
    "2": "car",
    "3": "pedestrian",
    "4": "22.00",
    "5": "1662972720233",
    "6": "6.01"
  },
  {
    "0": "8",
    "1": "1531x1532",
    "2": "car",
    "3": "pedestrian",
    "4": "0.20",
    "5": "1662972720232",
    "6": "5.02"
  },
  {
    "0": "7",
    "1": "1507x1510",
    "2": "car",
    "3": "pedestrian",
    "4": "4.92",
    "5": "1662972632432",
    "6": "27.65"
  },
  {
    "0": "6",
    "1": "1484x1485",
    "2": "car",
    "3": "pedestrian",
    "4": "7.49",
    "5": "1662972558566",
    "6": "23.11"
  },
  {
    "0": "5",
    "1": "1256x1260",
    "2": "car",
    "3": "bicycle",
    "4": "1.13",
    "5": "1662972312166",
    "6": "22.00"
  },
  {
    "0": "4",
    "1": "1257x1260",
    "2": "car",
    "3": "bicycle",
    "4": "5.89",
    "5": "1662972312166",
    "6": "24.57"
  },
  {
    "0": "3",
    "1": "1202x1196",
    "2": "car",
    "3": "pedestrian",
    "4": "4.66",
    "5": "1662972208433",
    "6": "5.34"
  },
  {
    "0": "2",
    "1": "648x656",
    "2": "car",
    "3": "bicycle",
    "4": "5.73",
    "5": "1662970861466",
    "6": "27.68"
  }
]

Output:

[
  {
    "id": "3220896668",
    "name": "1604x1596_Conflichts_ABBW",
    "created_at": "2022-09-12T12:47:44Z",
    "state": "active",
    "board": {
      "id": "3178950493"
    },
    "column_values": [
      {
        "id": "datum",
        "text": "",
        "title": "Tag",
        "type": "date",
        "value": null,
        "additional_info": null
      },
      {
        "id": "dup__of_table",
        "text": null,
        "title": "Kamera",
        "type": "color",
        "value": null,
        "additional_info": null
      },
      {
        "id": "dup__of_category_1",
        "text": null,
        "title": "Table",
        "type": "color",
        "value": null,
        "additional_info": null
      },
      {
        "id": "status3",
        "text": null,
        "title": "Category 1",
        "type": "color",
        "value": null,
        "additional_info": null
      },
      {
        "id": "status8",
        "text": null,
        "title": "Category 2",
        "type": "color",
        "value": null,
        "additional_info": null
      },
      {
        "id": "zahlen",
        "text": "",
        "title": "Duration",
        "type": "numeric",
        "value": null,
        "additional_info": null
      },
      {
        "id": "text",
        "text": "",
        "title": "Timestamp Start",
        "type": "text",
        "value": null,
        "additional_info": null
      },
      {
        "id": "zahlen9",
        "text": "",
        "title": "Avg Speed Velo",
        "type": "numeric",
        "value": null,
        "additional_info": null
      },
      {
        "id": "erstellungsprotokoll",
        "text": "2022-09-12 12:47:44 UTC",
        "title": "Erstellungsprotokoll",
        "type": "pulse-log",
        "value": null,
        "additional_info": null
      }
    ]
  }
]

Information on your n8n setup

  • n8n version: [email protected]
  • Database you’re using: SQLite
  • Running n8n via n8n.cloud

Hi @Nivar, welcome to the community!

It seems you are using an expression of {{$json["1"]}}_{{$node["Item Lists"].json["name"]}} in your first Monday node.

Now when passing on multiple items to the node, for the first incoming item the $node["Item Lists"].json["name"] part of your expression would fetch the name property of the first item from your Item Lists node which seems to work fine for you. For the second item, it would try to look up the second item from your Item Lists node which fails (since your first Item Lists node only has one item).

Could you try using an expression such as {{$json["1"]}}_{{$item(0).$node["Item Lists"].json["name"]}} in your Monday node? This should always read the first item from the Item Lists node (documented here).

1 Like

Hi @MutedJam
Thank you for your reply.
I think your explanation makes sense. So I tried it, but I have the same result. Nothing has changed.
Any other ideas?
Cheers
Nivar

Hey @Nivar,

What is the output of the webhook node? We would be able to use that to run most of your workflow to see what is happening. The first Monday.com node is also set to always output data so it could be that it is hitting an error and just moving on.

This is the output of the Webhook:

[
  {
    "headers": {
      "host": "some_host",
      "x-request-id": "e33dfe7937dd1bdb8ab5239d6f7f4afe",
      "x-real-ip": "some_ip",
      "x-forwarded-for": "some_ip",
      "x-forwarded-host": "some_host",
      "x-forwarded-port": "443",
      "x-forwarded-proto": "https",
      "x-forwarded-scheme": "https",
      "x-scheme": "https",
      "content-length": "9360",
      "accept": "*/*",
      "accept-encoding": "deflate, gzip",
      "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 X-Middleton/1",
      "content-type": "application/json"
    },
    "params": {},
    "query": {},
    "body": [
      {
        "analytic_id": 0,
        "block_name": "Kamera 1 FaSi",
        "cube_id": 0,
        "data": {
          "data": [
            [
              "32",
              "2107x2110",
              "car",
              "pedestrian",
              "5.57",
              "1663084151999",
              "4.16"
            ],
            [
              "31",
              "2105x2108",
              "car",
              "pedestrian",
              "5.69",
              "1663084140666",
              "29.07"
            ],
            [
              "30",
              "2107x2108",
              "car",
              "pedestrian",
              "5.69",
              "1663084140666",
              "29.07"
            ],
            [
              "29",
              "1348x1364",
              "bus",
              "pedestrian",
              "5.62",
              "1663082871866",
              "20.46"
            ],
            [
              "28",
              "1348x1358",
              "bus",
              "pedestrian",
              "0.90",
              "1663082871333",
              "17.13"
            ],
            [
              "27",
              "1348x1357",
              "bus",
              "pedestrian",
              "8.32",
              "1663082868533",
              "20.72"
            ],
            [
              "26",
              "1348x1353",
              "bus",
              "bicycle",
              "1.60",
              "1663082866666",
              "19.24"
            ],
            [
              "25",
              "1348x1345",
              "bus",
              "pedestrian",
              "6.39",
              "1663082862599",
              "24.00"
            ],
            [
              "24",
              "1148x1154",
              "car",
              "pedestrian",
              "9.13",
              "1663082563666",
              "16.76"
            ],
            [
              "23",
              "1148x1156",
              "car",
              "bicycle",
              "9.79",
              "1663082563766",
              "16.74"
            ],
            [
              "22",
              "1146x1154",
              "car",
              "pedestrian",
              "7.16",
              "1663082563666",
              "17.29"
            ],
            [
              "21",
              "1146x1156",
              "car",
              "bicycle",
              "7.43",
              "1663082563766",
              "16.67"
            ],
            [
              "20",
              "1165x1154",
              "car",
              "pedestrian",
              "9.13",
              "1663082563666",
              "16.76"
            ],
            [
              "19",
              "1165x1156",
              "car",
              "bicycle",
              "9.39",
              "1663082563766",
              "16.68"
            ],
            [
              "18",
              "1105x1112",
              "car",
              "pedestrian",
              "4.96",
              "1663082498233",
              "34.93"
            ],
            [
              "17",
              "933x935",
              "light",
              "pedestrian",
              "0.70",
              "1663082309766",
              "4.90"
            ],
            [
              "16",
              "875x920",
              "car",
              "pedestrian",
              "4.46",
              "1663082301433",
              "5.42"
            ],
            [
              "15",
              "909x914",
              "car",
              "bicycle",
              "3.63",
              "1663082294000",
              "32.01"
            ],
            [
              "14",
              "892x914",
              "car",
              "bicycle",
              "1.26",
              "1663082294000",
              "33.69"
            ],
            [
              "13",
              "872x914",
              "car",
              "bicycle",
              "5.19",
              "1663082294000",
              "32.21"
            ],
            [
              "12",
              "875x914",
              "car",
              "bicycle",
              "5.39",
              "1663082294000",
              "32.19"
            ],
            [
              "11",
              "872x905",
              "car",
              "bicycle",
              "7.49",
              "1663082283832",
              "23.29"
            ],
            [
              "10",
              "875x905",
              "car",
              "bicycle",
              "7.49",
              "1663082283832",
              "23.29"
            ],
            [
              "9",
              "872x888",
              "car",
              "bicycle",
              "11.59",
              "1663082268033",
              "14.92"
            ],
            [
              "8",
              "875x888",
              "car",
              "bicycle",
              "11.59",
              "1663082268033",
              "14.92"
            ],
            [
              "7",
              "618x615",
              "car",
              "bicycle",
              "6.86",
              "1663081797066",
              "25.41"
            ],
            [
              "6",
              "399x415",
              "car",
              "bicycle",
              "7.19",
              "1663081469499",
              "19.81"
            ],
            [
              "5",
              "238x242",
              "car",
              "bicycle",
              "6.23",
              "1663081284232",
              "28.08"
            ],
            [
              "4",
              "168x177",
              "car",
              "bicycle",
              "11.95",
              "1663081188132",
              "15.14"
            ],
            [
              "3",
              "132x104",
              "car",
              "pedestrian",
              "33.40",
              "1663081120533",
              "4.11"
            ],
            [
              "2",
              "121x104",
              "car",
              "pedestrian",
              "27.39",
              "1663081120533",
              "4.21"
            ],
            [
              "1",
              "114x104",
              "car",
              "pedestrian",
              "6.33",
              "1663081120533",
              "3.97"
            ],
            [
              "0",
              "114x110",
              "car",
              "bicycle",
              "7.29",
              "1663081122866",
              "22.82"
            ]
          ],
          "data_end_time": "0",
          "data_start_time": "0",
          "data_validity": "ok",
          "evaluation_validity": "ok",
          "first_row_index": 0,
          "header": [
            "#",
            "ID",
            "Category 1",
            "Category 2",
            "Duration",
            "Timestamp Start",
            "Avg Speed Velo"
          ],
          "last_reset_time": "1663084595933",
          "number_of_rows": 33,
          "object_count": 0,
          "order": "ascending",
          "table_size": 33,
          "units": [
            "",
            "",
            "",
            "",`Preformatted text`

> Blockquote

"s",
            "",
            "kmh"
          ]
        },
        "data_end_timestamp": "1663084595933",
        "data_start_timestamp": "1663084595933",
        "id": 169,
        "name": "Conflichts_ABBW",
        "operator_attribute": "expression",
        "output_type": "widget",
        "output_value_type": "table"
      }
    ]
  }
]
````Preformatted text`

The first [Monday.com](http://monday.com/) node is also set to always output data so it could be that it is hitting an error and just moving on.
--> Could be, but i see nothing. And it's a search> no output = still a valid output...

Hi @Nivar, the example you have provided doesn’t seem to be valid JSON.

I just tried reproducing your problem using a Monday “board” I’ve created in my trial account like so:

I’ve then tried running a simplified workflow fetching these three separate items:

This is working as expected, the Monday node retrieves all three items as expected:

This still seems like problem be with your expression in the Monday node as mentioned earlier. {{$node["Item Lists"].json["name"]} would read the name field from your Item Lists node which has only one item from the looks of it (as the body field coming from your webhook node is an object, not an array with multiple objects).

Perhaps you can try a simplified workflow using hardcoded values first (similar to what I did in my example) and verify if this is working for you?

In the next step, perhaps can you share the correct JSON structure coming from your webhook node so we can take a look at it?

1 Like