Unable to access nested data from a IF node

Hey n8n community,

Can anyone explain why this IF node data is not accessible when I use a $ifEmpty() expression?

The node returns undefined even though there is data and if I access without the $ifEmpty() expression the data is read without issue.

Steps

  • I’m checking if the user exists in my DB then using the IF node to funnel based on the outcome.
  • If TRUE, the output is an empty array, therefore I thought the $ifEmpty() would be perfect for this as if FALSE the node branches to a create user node.
  • At the stage where I’m getting the error there will always be data returned either from the TRUE OR FALSE outcome.
  • I’ve even tried just declaring $json.id since there will always be an id but this also causes undefined to be returned.
  • I’ve also tried accessing the node directly by name

Flow
{BF493651-F3FD-4EE1-AF9F-6705D4785511}

Error

Information on your n8n setup

  • n8n version: 1.75.2
  • Database:SQLite
  • n8n EXECUTIONS_PROCESS setting:own, main
  • Running n8n via :Docker
  • Operating system: Linux Ubuntu 20.04

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

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