"[ERROR: Can’t get data for expression]" on Set node variable preview when connected to both ends of If node

Hey @Ameurj,

This has an engineer assigned and should be fixed soon but I don’t think this is actually breaking the workflow and it is just a cosmetic thing.

In your case is the workflow actually failing?

Hello is there an interal tracker for this, we seem to be expericing the issue above as well.

Hi @roozbehk, we’re tracking this internally as ADO-794. That said, I’ve just reviewed the current status and there doesn’t seem to be an update unfortunately.

Perhaps @Niklas_Hatje from our product team can share a timeline here?

Hi @roozbehk, sorry that this ticket has been going on for so long. I’m afraid that I can’t give a 100% accurate timeline on this, since we’re having a lot of other tickets that are currently a little higher in priority. I will give the ticket another ping so that we can discuss it again.

1 Like

I actually think I fixed that issue a few weeks ago. Created a ticket in linear for somebody to cherry pick it from the langchain branch.

1 Like

Hello
There was a bugfix today, but nothing has changed.
n8n Version 1.8.2

Ah yes, that is expected. After all, did no version which includes that bugfix get released yet. The release is however planned for tomorrow and will then be available with version 1.9.0.

2 Likes

New version [email protected] got released which includes the GitHub PR 7257.

Oh, noticed that topic and PR 7257 describes a similar to my but not the same problem and version 1.9.0 did not help to solve it.

In my case there is only one incoming connection, but I am trying to get data from a trigger that is not directly connected to the node and get same error

Lately with the switch to n8n 1.xxx version I very rarely use reference to nodes that were previously there, I prefer to fully pass the original stream by enriching the data.

Check out multiplex or merge by position to find a solution that works for you. The old node references may not work or worls unstable, so I’m redoing it this way now.

1 Like

Just dropping a note to say I found this thread because of the same error, and sadly it is still occurring (version 1.11.2). The temporary fix is to use $(‘node name here’).first().json.param_name_here instead of $(‘node name here’).item.json.param_name_here

1 Like

Thanks @James_Pardoe … this helped me - but this “bug” is till alive and kicking.

1 Like

In my case I’m seeing the error after the IF node and my workflow executions are erroring out so, this isn’t just a display issue for me.

ERROR: Can’t get data for expression under ‘Could not find parameter “undefined”’ field

In node ‘undefined’, output item 0 points to an input item on node ‘IF‘ that doesn’t exist.

Details

Time

11/28/2023, 8:28:18 PM

Item Index: 0

HTTP Code

none

Stack

NodeApiError: Can’t get data for expression
    at RoutingNode.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/RoutingNode.js:116:23)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:707:23)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:652:53

Hey @Ibanez1998,

When you see this in the http request node is the data coming from the true or the false branch on the If? If the data is coming from both that may cause an issue so it would be interesting to see what happens if you have 2 http request nodes one for the false output and one for the true output.

That worked! I was having the same issue with the Notion node and your fix solved it for me. Why do you think this is a temporary fix? “first()” doesn’t work on all cases?

This works, I had the same issue trying to write to a Google Sheet Node

Had to change from:
{{ $(‘Event’).item.json.body.entry[0].changes[0].value.messages[0].button.text }}
to
{{ $(‘Event’).first().json.body.entry[0].changes[0].value.messages[0].button.text }}

Thanks for this first() tip! As I ran into this problem today on a workflow that has worked fine for over a few days. Is there a reason it’s considered temporary? And will the error be fixed before first() stops working?

Hello! the bug still exists. The option using “.first()” does not help me, because I have array of items and the “first” will always return a first item, logical =)

What really helped me is using other syntax: instead of $(‘Set user’).item.json.uuid works $node[‘Set user’].json[‘uuid’]

Actually, I encountered the same problem after using the node “HTTP REQUEST NODE” and this syntax helps.

1 Like

Glad the first() tip helped a few of you. I said “temporary” because first() only works for the first item and like Ivan said, it won’t work if there is more than one. So I prefer to use item as it’s more flexible. Hence, it’s a temporary fix until item is working.

1 Like