If node - reference to previous node not working

Describe the problem/error/question

I have a flow with several IF nodes. The last IF node checking for a date is with an expression where one of the comparison item is a reference to a data point from a previous node. However, the node returns [undefine]

Please share your workflow

Information on your n8n setup

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

Hi @fxholl, I am very sorry you’re having trouble.

I tried reproducing this on [email protected] using the below test workflow (since your test workflow requires credentials to work from the looks of it) including your IF node:

However, after executing the entire workflow, my expression preview is working as expected:

Is there a chance you can provide an example workflow I’d be able to run?

Thank you!

Here is the workflow minus the https that require credencial. The problem happens in the third IF node called “IF new customer”.

Thanks @fxholl, I was now able to see the problem!

I’ll play around with this some more to try and understand when exactly this occurs (I suspect it might be similar or even related to this issue).

In the meantime, seeing this appears to affect just the preview but not the actual execution, perhaps you simply want to add a Set node in front of the If node in question reading this value for you? Like so:

The preview on the Set node will still fail, but it’ll return the correct value:

You can then use this new field inside your IF node for building your expression with a working preview:

2 Likes

Adding the set node worked: the preview on the Set node does fail, but it returns the correct value.

Thank you so much!

1 Like

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