IF node testing for empty field returns that field is not empty

I need to handle the case where the last_name field is empty.

I use an IF node testing if field is empty, but the node always returns False even when empty.

Any suggestion?

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

The problem looks like the field isn’t actually empty, since it has some whitespace in it. If you trim the field before passing the item into the ‘if’ node, it should work:

But the expression shouldn’t be showing [empty] when the value isn’t really empty — we’ll look into fixing that.

1 Like

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

New version [email protected] got released which includes the GitHub PR 6003.