Add data columns

Hi guys,

how can I add a data item? I would like to add the article_id with only the first 8 characters as article_new?

Spreadsheet File Results:

[
{
"article_id": "12345678-001",
},
{
"article_id": "89123456-001",
}
]
const newItems = [];

for(let i=0; i<items.length; i++) {
    items[i].json.article_new = String(items[i].json.article_id).substring(0, 8);
    newItems.push({json: items[i].json});

}

return newItems;
4 Likes