What voodoo is this: $item(0).$node['some name']

Hello,

Recently I saw this notation in a n8n flow:

$item(0).$['some node'].json.someKey

It worked fine, but I wonder how I read this. What is this $item(0)?
I also suspect this is deprecated code.

Love n8n, by the way, but it does mystify me occasionally.

Kind regards,

Jos

Hey @Jos_van_Uden,

That looks like the old syntax for selecting the first item of some node, You would do that now with $('some node').first().json.someKey or $('some node').all()[0].json.someKey

You can find the list of current options here: Output of other nodes | n8n Docs

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.