# Unbundle JSON with Function Node and Add New Key

**URL:** <https://community.n8n.io/t/unbundle-json-with-function-node-and-add-new-key/7003>\
**Category:** Questions\
**Created:** [July 30, 2021, 4:52am UTC](https://community.n8n.io/t/unbundle-json-with-function-node-and-add-new-key/7003 "2021-07-30T04:52:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigmet](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sigmet/32/5629_2.png) [@sigmet](https://community.n8n.io/u/sigmet)\
**Post date:** [July 30, 2021, 4:52am UTC](https://community.n8n.io/t/unbundle-json-with-function-node-and-add-new-key/7003/1 "2021-07-30T04:52:30Z")

</div>

Hi All. I’m using a function node to unbundle an api response  
`return items[0].json.records.map(x => ({ json: x }));`

but i’d need to add a new key to each item  
`const apiKey = '123456';`

What would be the best practice to achieve this? Thanks!

---

<div class="post-metadata">

**Author:** ![shrey-42](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/shrey-42/32/3437_2.png) [@shrey-42](https://community.n8n.io/u/shrey-42)\
**Post date:** [July 30, 2021, 5:49am UTC](https://community.n8n.io/t/unbundle-json-with-function-node-and-add-new-key/7003/2 "2021-07-30T05:49:27Z")

</div>

This’ll work:

```auto
return items[0].json.records.map(x => {
    x.apiKey = '123456';
    return {json: x};
});

```

---

<div class="post-metadata">

**Author:** ![sigmet](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sigmet/32/5629_2.png) [@sigmet](https://community.n8n.io/u/sigmet)\
**Post date:** [July 30, 2021, 7:50am UTC](https://community.n8n.io/t/unbundle-json-with-function-node-and-add-new-key/7003/3 "2021-07-30T07:50:37Z")

</div>

@shrey-42 Thanks for helping out! Much appreciated!
