Microsoft SQL return no data

Microsoft SQL return no data

When I try to run a SQL query and there’s no data to return, it returns an empty array. When I try to run an if and enter the data to validate, like {{Object.keys($items()[0].json).length === 0}}, it doesn’t work; the node closes.

  • n8n version: 1.92.2
  • Database :Microsoft SQL
  • Running n8n via n8n cloud

Hi Len,

I would make sure the SQL Server node settings are set to Always Output Data and change the IF node to check if an item exists / does not exist in the JSON from the SQL node. For example:

Any use ?

Rgds
Simon

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