Hi! I’m attempting to automatically get the last item of a nested JSON array whether it has one or many. Below is an example of my data flow, the focus would be “Collections” => “Category” => Last Item (category:2). I’m sorry if it doesn’t make sense, I will try my best to clarify if there’s any confusion. Thank in advance!
{
"neighborhood": {
"id": 260,
"name": "WASHINGTON HEIGHTS"
},`
"city": {
"id": 3,
"name": "Manhattan"
},
"collections": [
{
"id": 22,
"name": "New Yorker",
"description": "-",
"category": 1,
"yield_boost": 1.2
},
{
"id": 24,
"name": "New Yorker Plus",
"description": "-",
"category": 2,
"yield_boost": 1.2
},
]
},
## Information on your n8n setup
- **n8n version: 0.193.5**
- **Running n8n via npm**