Describe the problem/error/question
I have an item that contains an array I would like to split down. Each of the array items has a unique name that represents what the contents of the array are, in this case the results of the last 30 days of my email protection report.
Using the split node on the inbound array does indeed split it down as needed, however I lose the headers in each of the arrays, which I need as labels.
Any assistance would be appreciated.
Please share your workflow
Share the output returned by the last node
Before
{
"accountId": "######",
"type": "email",
"period": "24h",
"count": "30",
"inbound": {
"allowed:none:_total": {
"2024-04-18T00:00:00+0000": 26,
"2024-04-19T00:00:00+0000": 21,
"2024-04-20T00:00:00+0000": 10,
"2024-04-21T00:00:00+0000": 8,
"2024-04-22T00:00:00+0000": 138,
"2024-04-23T00:00:00+0000": 53,
"2024-04-24T00:00:00+0000": 29,
"2024-04-25T00:00:00+0000": 40
},
"allowed:none:none": {
"2024-04-18T00:00:00+0000": 26,
"2024-04-19T00:00:00+0000": 21,
"2024-04-20T00:00:00+0000": 10,
"2024-04-21T00:00:00+0000": 8,
"2024-04-22T00:00:00+0000": 138,
"2024-04-23T00:00:00+0000": 53,
"2024-04-24T00:00:00+0000": 29,
"2024-04-25T00:00:00+0000": 40
},
After
[
{
"accountId": ""######",",
"type": "email",
"period": "24h",
"count": "30",
"outbound": {
},
"inbound": {
"2024-04-18T00:00:00+0000": 26,
"2024-04-19T00:00:00+0000": 21,
"2024-04-20T00:00:00+0000": 10,
"2024-04-21T00:00:00+0000": 8,
"2024-04-22T00:00:00+0000": 138,
"2024-04-23T00:00:00+0000": 53,
"2024-04-24T00:00:00+0000": 29,
"2024-04-25T00:00:00+0000": 40
}
},
{
"accountId": ""######",",
"type": "email",
"period": "24h",
"count": "30",
"outbound": {
},
"inbound": {
"2024-04-18T00:00:00+0000": 26,
"2024-04-19T00:00:00+0000": 21,
"2024-04-20T00:00:00+0000": 10,
"2024-04-21T00:00:00+0000": 8,
"2024-04-22T00:00:00+0000": 138,
"2024-04-23T00:00:00+0000": 53,
"2024-04-24T00:00:00+0000": 29,
"2024-04-25T00:00:00+0000": 40
}
}
Information on your n8n setup
- n8n version:1.38.1
- Database (default: SQLite): default
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via Docker
- Operating system: Win 11 via WSL