'if row exists' doesn't return the row that exists

Hey there,

As far as I understand, ‘if row exists’ should return the row if it exists, but in my tests, it returns the output from the preceding node.

I’m quite new to n8n, so it might be just a configuration issue on my side.

In this example, first I generate random data and then check if a row exists. It does exist, but the output is the random data.

Thanks for your help in advance!

Pablo

Describe the problem/error/question

What is the error message (if any)?

No error message, the wrong object is returned.

Please share your workflow

Share the output returned by the last node

[

{

“uid”:
“dfc66ff0-ed32-41de-ab55-ea201e4a9004”,

“email”:
[email protected]”,

“firstname”:
“Felix”,

“lastname”:
“Doyle”,

“password”:
“i57+dizMK”

}
]

Information on your n8n setup

  • n8n version: 1.120.3
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via: Docker
  • Operating system: Ubuntu 24.04.1 LTS

The documentation is not very clear: Data table | n8n Docs

If that is the intended behaviour, then you need to have a ‘Get rows’ node just before the ‘if row exists’ with almost the same logic, so kind of redundant?

Maybe this is a common n8n pattern I’m not aware of, so would appreciate some clarity.

Thanks!

Pablo

The documentation may not be very clear on this one :grin:

If row exists data table node passes the items it receives if a matching row exists. If the row doesn’t exist, this node won’t output anything. So make sure to toggle on Always Output Data from node settings so your workflow doesn’t stop.

It’s different than other nodes, and its closer to the IF node as it is a statement. You can attach Get row(s) data table node after it if you want to retrieve all values for that row.

2 Likes

Thanks for clarifying!

But what’s the point of ‘if row exists’ then? You can just use ‘get rows’ and check if the output is empty or not. You achieve the same with less compute.

1 Like

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