I have some data like this, which is part of a larger object (and are many objects like this):
"departments": [
{
"id": 10111,
"name": "Sales",
},
{
"id": 10115,
"name": "Super Sales",
}
],
And I would like to output:
“departments”=“Sales, Super Sales”
I can split out each child of the departments in the array into 2 separate items using
return items[0].json.departments.map(item => ( { json : item } ));
But I am only interested in departments.name
In the example there are only 2 departments but looking for a solution that will work for an number of departments (but usually between 1 and 3).