I’m unable to get all items returned by a Code node into another far off non-connected node.
What is the error message (if any)?
Using {{ $('A Code Node').item.json.columnA }} on distant nodes only retrieves the first value from Column A, despite the Code node outputting 10 items. {{ $json.columnA }} works, but not across nodes separated by ‘If’ nodes. Is there a way to access all items in this scenario?
Information on your n8n setup
n8n version: 1.45.1
Database (default: SQLite): Postgres
n8n EXECUTIONS_PROCESS setting (default: own, main): main
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
I’ve attached an example. Currently, the data I want to access from the ‘split’ node is separated by an ‘if’ node that is set to execute once. Is there a way for the last ‘set’ node, ‘only columnA’, to retrieve all three items from the ‘split’ node? {{ $('split').item.json.columnA }} only gets the first item but rest.
Thanks! I also added a null check {{ $('split').all().map(x => x.json.columnA).filter(columnA => columnA != null) }} and Split node after the Set node that iterates over the array to split out items for further looping.