Set node assigns blank values in second item instead of assigned values, first item works fine

Describe the problem/error/question

The first item title and all other fields are changed and have gotten the correct value, while the second item received none of the other inputs in the set node. Is this a bug in the set node, or are we doing something wrong?

Information on your n8n setup

  • n8n version: 0.225.2

Hey @timautomation,

Can you share the full workflow? The bit I am interested in seeing is if the node you are getting the data from is before the set node or a few nodes back. If it is a few nodes back you might have more luck with $('node name').item.json

Hi Jon, Thanks for the quick answer. I cannot share the full workflow as it contains sensitive data. The node is indeed 9 nodes back. I will try the way you put it.

Hi Jon,

Thanks, this worked :slight_smile:

We changed the value
from: {{$node[“Dienst data”].json[“Dienstnaam”]}}
to: {{$(‘Dienst data’).item.json [‘Dienstnaam’]}}

We have no idea why this works and where to find this in the documentation, can you help us out with that?

Kind regards,

Tim

This also works but is it recommended to do?
{{$(‘Dienst data’).item.json.Dienstnaam}}

Hey @timautomation,

This is the page in the docs that will be useful: Built in methods and variables reference | n8n Docs

Hi Jon,

Thanks for the answer. I’ve visited that page a couple of time now. but i cannot make sense of it. Also the way you prescribed to direct the right field $(‘node name’).item.json is not on that page, is it somewhere else in the documentation? same as $(‘node name’).item.json [‘field’] or $(‘Node name’).item.json.field

When we use n8n and use the variable selector n8n uses another method of directing to the right field {{ $node[“node name”].json[“field”] }}, see the screenshot.

Thats why we are a little bit confused. What is the most modern and good way that we can use in n8n for directing to a field in another node?

Hey @timautomation,

The option I suggested is the 4th one down on the list under the Output of other nodes heading. It sounds like we still need to update the variable selector but generally the $() option is the way forward.

1 Like

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