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!
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!
This’ll work:
return items[0].json.records.map(x => {
x.apiKey = '123456';
return {json: x};
});