Files
n8n-docs/docs/code-examples/javascript-functions/methods-variables/item-at.md
2022-08-30 16:36:31 +01:00

632 B

$("").itemAt(itemIndex:number, branchIndex?:number runIndex?:number)

This method allows you to return an item at a specific index. The index is zero-based. Hence, $("<node-name>").itemAt(0) returns the first item, $("<node-name>").itemAt(1) the second one, and so on.

Example:

// Returns the first item returned by the Example node
const firstItem = $item(0).$node["Example Node"];

// Returns the second item returned by the Example node
const secondItem = $item(1).$node["Example Node"];

Refer to this example workflow to learn how this method can be used.