Mapping in the expressions editor#
These examples show how to access linked items in the expressions editor. Refer to expressions for more information on expressions, including built in variables and methods.
For information on errors with mapping and linking items, refer to Item linking errors.
Access the linked item in a previous node's output#
When you use this, n8n works back up the item linking chain, to find the parent item in the given node.
1 2 |
|
As a longer example, consider a scenario where a node earlier in the workflow has the following output data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
To extract the name, use the following expression:
1 |
|
Access the linked item in the current node's input#
In this case, the item linking is within the node: find the input item that the node links to an output item.
1 2 |
|
As a longer example, consider a scenario where the current node has the following input data:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
To extract the name, you'd normally use drag-and-drop Data mapping, but you could also write the following expression:
1 |
|