I’m having a bit of trouble with a set node.
I’m using the notion node to get a database name, then I pass that name to a set node under a text variable.
Hi @Daniel_Barra, hope you’re having a good day? Most nodes run once for each item, so it sounds like for your second (and subsequent items) there is no item. In that case could try an expression like {{$items("My Node")[0].json["foo"]}} where My Node is your Notion node and foo is the field with the database name.
The $items() method would always refer to all items of the current or previous nodes, so by using [0] you reference the very first item regardless of how many items you have.
Example Workflow
(This uses an HTTP Request and an Item Lists node to get some example items.)
Alternatively, if your Set node following the Notion node afterwards only returns one item, you could use the Merge node in Multiplex mode. This would also add the single field to each item:
Example Workflow
Hope this gives you some pointers! Let me know if I misunderstood you here or you have any further questions on this.
It is probably worth opening a new topic but to answer your question the old method should still work. Below is a workflow that shows both the old and new ways in the set node. You can find more about this here: Built in methods and variables reference - n8n Documentation