Describe the problem/error/question
I am trying to understand the difference between these two expressions in n8n: $node["nodo"].json.elemento and $('nodo').item.json.elemento. Both seem to fetch an element from a previous node, but I’m noticing some inconsistencies in their behavior.
What is the error message (if any)?
No error message, but the behavior during the design phase of the flow differs. When I use $('nodo').item.json.elemento, it doesn’t show the result in the expression builder, though it does fetch the result during execution. In contrast, $node["nodo"].json.elemento shows the result during the design phase.
Additional Context:
Why does the expression constructor in n8n default to using the second form ($('nodo').item.json.elemento), and how can I make it default to the first form ($node["nodo"].json.elemento), which seems clearer to me?
Please share your workflow
(Workflow details omitted for brevity, but the main focus is on the usage of the mentioned expressions in accessing data from previous nodes.)
Share the output returned by the last node
Not applicable, as the question is more about expression behavior than specific output.
Information on your n8n setup
- n8n version: last version
- Database (default: SQLite): SQLite
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Synology NAS. DSM OS