How to check whether a Node is available in a condition or not

Hi,

I’m using the latest version of n8n and I’m new to the platform. I’m trying to set a value in an Edit Fields node that sits inside a loop and runs conditionally. The relevant node is “ModifiedData”, a Code node that returns a filtered JavaScript object—but it executes only when a specific condition is true.

The next node needs to gather text from both the true and false branches. When ModifiedData doesn’t run, the Edit Fields node throws an error because the value is missing. I tried this expression:

{{ $('ModifiedData')?.item?.json?.textInput }}

When the condition is false, the expression doesn’t return null; instead, it causes an error. I want to detect whether ModifiedData exists in the false branch and, if not, set the field to null in Edit Fields.

Sorry if this is a basic question, but I’m stuck and would appreciate any guidance.
Thanks
Tanvir

Did you activate Always output data fields?

1 Like

Thanks mate. It worked :folded_hands:

You’re welcome, cheers mate!