# Use a list generated in a Function into another function

**URL:** <https://community.n8n.io/t/use-a-list-generated-in-a-function-into-another-function/14065>\
**Category:** Questions\
**Tags:** function\
**Created:** [May 18, 2022, 3:35pm UTC](https://community.n8n.io/t/use-a-list-generated-in-a-function-into-another-function/14065 "2022-05-18T15:35:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Pedot](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/thomas_pedot/32/11975_2.png) [@Thomas\_Pedot](https://community.n8n.io/u/Thomas_Pedot)\
**Post date:** [May 18, 2022, 3:35pm UTC](https://community.n8n.io/t/use-a-list-generated-in-a-function-into-another-function/14065/1 "2022-05-18T15:35:36Z")

</div>

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

```auto
  "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](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)

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [May 18, 2022, 4:31pm UTC](https://community.n8n.io/t/use-a-list-generated-in-a-function-into-another-function/14065/2 "2022-05-18T16:31:06Z")

</div>

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.
