Link item in code node

Describe the issue/error/question

I am trying to build a code node that will transform the data from tekst to a number when it matches the input. The javascript code i use works when i fill the let statusnummer with a string like “Lopend” but I cannot figure out (read a lot of documentation on the n8n site and community) how to connect the in coming item to my let statusnummer. How do you pinpoint a specific value of the input in de code node? Tried to read this article as it supposed to be in here but i cannot understand. Item linking in the Code node - n8n Documentation

What is the error message (if any)?

Cannot read properties of undefined (reading ‘value’) [line 1]

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:0.213.0
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

I found the answer, but i would suggest making the documentation about linking data more comprehensive. The way it worked was when i approached it like this $("Node").item.json.[0].
so for example $("Set").item.json.records[0].Status__c or (why I dunno) sometimes it is $("Set").item.json.records.Status__c

3 Likes

Hi @timautomation, thanks so much for sharing your feedback. The page could indeed use an overhaul, seeing it refers to the older Function node. I’ll add this to our backlog!