When using 'If' in flow, it gives wrong results every time

Hi there!

I’m using an ‘If’ in a flow and when checking for whether an object exists, it claims it doesn’t, while at the same time showing the values of the same object and array data on the left hand side. This also happens when checking if a given value in the array is empty or not; it claims it’s empty, while showing the value of the field on the left hand side.

If I remove the ‘If’ and after that insert a new ‘If’ in place, it works for one run and then changes into a function that doesn’t work.

So… I can’t use this function in a flow for this reason. How to solve it?

Thanks in advance!

I’m running n8n in a docker container, use MySQL to get the data from the array and the whole thing is on a Linux server, updated to the latest version (n8n, docker-ce, Ubuntu 22.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:

Hi @Michel_Hageman

Welcome to the community!

I think this is caused by a bug that can mess up some data when coming from a SQL Query.
Can you try to put a code node in between de nodes and see if that fixes it?
Code not just needs to return all data, the standard code it provides when placing it should work.

If that doesn’t work we will need to see the actual workflow and some sample data to test and help you. :slight_smile:

1 Like

Thank you, that seems to do the trick thankfully!

1 Like

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