Replicate value

How can I recycle the values of urlBaseNova and apiKeyNova for the other items in the array?

Hey @Ruan17,

I don’t know why, but for me when I run it with the expression like this, it runs perfectly {{ $node[“DADOS KUTT”].json[“urlBaseNova”] }}

Then test and see if it works.

1 Like


the same bug, it only stays in the first item, for the next ones they still don’t go

Seeing as your DADOS node has only one item output, and the node your referencing has multiple, the first item works, but the subsequent items 2-11 are looking for items 2-11 on the DADOS node which don’t exist (undefined).

If your n8n version is new enough you can use the new magical item linking
$('DADOS KUTT').item.json.urlBaseNova which should know that each of those 11 items in Set1 relate to item 1 in the DADOS node.

The alternative, if the DADOS node will only ever output a single item is to use $('DADOS KUTT').first().json.urlBaseNova, or $('DADOS KUTT').itemMatching(0).json.urlBaseNova. The old version of this was $item(0).$node['DADOS KUTT'].data.urlBaseNova

Check these specific docs - Built in methods and variables reference - n8n Documentation

Here’s a sample workflow with each type of expression and the result

3 Likes

It worked perfectly, thanks a lot for the help! Now how did you know how to use {{ $('KUTT DATA').item.json.urlBaseNova }} because I only knew how to use these two {{ $node["DADOS KUTT"].json["urlBaseNova"] }} and {{ $node["KUTT DATA"].json.urlBaseNew }}

I want to know so I can study more

1 Like

The docs mate :joy:

true🤣 I thought it was only for use in the node code hahaha and do you have any link to use the node code?

The documentation there applies to both the code node, and anywhere you can write an expression. One exception… the column that says Available in Code node? :wink:

What I would recommend is doing the n8n courses, however I’m not sure they’ve been updated with the code node, and updated method/referencing…

thanks. I will study about

1 Like

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