Undefined expressions

Why is my expression returning undefined even though the field exists

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@Oscar_Abaleke nine times out of ten this is the expression path not matching the actual json shape, dot notation like {{ $json.field }} only reaches a real nested child, so if your key has a space or a dot in the name itself it returns undefined and you need bracket notation with the exact key, {{ $json[‘your field’] }}. the other common one is the field actually living on an earlier node rather than the immediate input, so $json points at the wrong step. can you paste the exact expression youre using and a screenshot of the input panel for that node so i can see the real key?

Hi @Oscar_Abaleke

Majority cause is the field may have been removed or modified by an upstream Set, Edit Fields, or Code node.

Check the data output of the previous node, whether “Keep Only Set Fields” is enabled and always ensure that the exact JSON path is being referenced

if the exression is valid the node name everything,use

first().json instead of item.json

One more thing to check: if the field exists in a node that’s not directly connected to the current node in the chain, the default $json.fieldName or $item().json.fieldName won’t reach it. You’d need $('Node Name').item.json.fieldName to pull from a specific upstream node by name.

Also - if the expression preview in the editor shows undefined but the workflow runs fine (or shows a value in execution output), it usually means the editor is using data from an old run. Re-run the upstream node manually so the editor has fresh data to evaluate against.