From 5105d1b31ef3c19387db5a70812c98f62ef71df9 Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Mon, 27 Feb 2023 13:48:27 +0000 Subject: [PATCH] add code snippet to error section --- .../data-mapping/item-linking-code-node.md | 1 + .../data-item-linking/item-linking-errors.md | 21 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/_snippets/data/data-mapping/item-linking-code-node.md b/_snippets/data/data-mapping/item-linking-code-node.md index b6e480d92..d251990f0 100644 --- a/_snippets/data/data-mapping/item-linking-code-node.md +++ b/_snippets/data/data-mapping/item-linking-code-node.md @@ -16,6 +16,7 @@ To control item linking, set `pairedItem` when returning data. For example, to l "json": { . . . }, + // The index of the input item that generated this output item "pairedItem": 0 } ] diff --git a/docs/data/data-mapping/data-item-linking/item-linking-errors.md b/docs/data/data-mapping/data-item-linking/item-linking-errors.md index d411c965e..37d2ddd84 100644 --- a/docs/data/data-mapping/data-item-linking/item-linking-errors.md +++ b/docs/data/data-mapping/data-item-linking/item-linking-errors.md @@ -22,5 +22,24 @@ If you see this error message: > ERROR: Can't get data for expression under '``' field -You need to supply item linking information yourself, because you have an item linking scenario that n8n can't automatically handle. Refer to [Item linking concepts](/data/data-mapping/data-item-linking/item-linking-concepts/) for a conceptual understanding of item linking, and [Manage item linking in the Code node](/data/data-mapping/data-item-linking/item-linking-code-node/) for detailed guidance on handling item linking. +You need to supply item linking information yourself, because you have an item linking scenario that n8n can't automatically handle. + +To control item linking, set `pairedItem` when returning data. For example, to link to the item at index 0: + +```js +[ + { + "json": { + . . . + }, + // The index of the input item that generated this output item + "pairedItem": 0 + } +] +``` + + +Refer to [Item linking concepts](/data/data-mapping/data-item-linking/item-linking-concepts/) for a conceptual understanding of item linking, and [Manage item linking in the Code node](/data/data-mapping/data-item-linking/item-linking-code-node/) for detailed guidance on handling item linking. + +