If statement doesn't evaluate input (TypeError: Cannot read properties of null (reading 'toString'))

Describe the issue/error/question

I am building my first more complex workflow and I am running into a problem regarding two IF statements at the end of my workflow.

What I am doing with this workflow is validating email addresses that where entered into my crm (Pipedrive).

I am passing along the email address that I have or find, to different email services and validating them through Zerobounce. If a Zerobounce validation passes as valid, the workflow is done. If that doesn’t happen I want to check at the end what the validation was of the email services that I use to find email addresses. If those have an acceptable validation I will enter them into Pipedrive as well.

This is my workflow:

The problem now, is that these checks at the end (the two if statements) are never true. But I don’t think that is right. I know this as multiple addresses are found, and then not verified by zerobounce. They should end up at the if statements and evaluate to true a couple of times. I think there is something wrong with the data that is passed to the if statement nodes:

I have tried debugging this problem for two hours now, but I can’t figure out what the problem is.

Any idea what the problem is?

What is the error message (if any)?


Information on your n8n setup

  • n8n version: 0.219.1
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker


I missed this one, Give me 20 minutes to check something else and I will take a look.

Ok thanks! :slight_smile:

Rather than using the name of the node in the “If Apollo.io acceptable” it might be worth just using $json.person.email_status as the data is coming from the node before it. That might help solve some of the issues you are seeing.

Hi Jon, thanks I will look into that! But is my code in essense wrong with what I’m doing? Taking output from an IF node later in a workflow?

In theory it can work but doing it like that has other possible issues so it would be better to use the $(“node name”) options instead.

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