Use a list generated in a Function into another function

Hello,
I generate a list inside a function called GenerateList.

  "nodes": [
    {
      "parameters": {
        "functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n// Tip: You can use luxon for dates and $jmespath for querying JSON structures\n\n\nreturn [['alice','john']];"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        720,
        280
      ]
    },
    {
      "parameters": {},
      "name": "Function1",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        1240,
        360
      ]
    }
  ],
  "connections": {}
}

And I want to use to list (for a loop) inside another Function1.

https://docs.n8n.io/integrations/core-nodes/n8n-nodes-base.function/?utm_source=n8n_app&utm_medium=node_settings_modal-credential_link&utm_campaign=n8n-nodes-base.function#variable-items

Hey @Thomas_Pedot,

In the second node in the item loop you can access the array with item.json so you would use that for your processing within that loop. The below should help, Let me know how you get on.

1 Like