Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add common issues for the set node #2585

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
title: Edit Fields (Set) node common issues
description: Documentation for common issues and questions in the Execute Command node in n8n, a workflow automation platform. Includes details of the issue and suggested solutions.
contentType: integration
priority: high
---

# Edit Fields (Set) node common issues

Here are some common errors and issues with the [Edit Fields (Set) node](/integrations/builtin/core-nodes/n8n-nodes-base.set/) and steps to resolve or troubleshoot them.

## The 'JSON Output' in item 0 contains invalid JSON

This error occurs when you use JSON mode but don't provide a valid JSON object. Depending on the problem with the JSON object, the error sometimes display as `The 'JSON Output' in item 0 does not contain a valid JSON object`.

To resolve this, make sure that the code you provide is valid JSON:

* Check the JSON with a [JSON validator](https://jsonlint.com/){:target=_blank .external-link}.
* Check that your JSON object doesn't reference undefined input data. This may occur if the incoming data doesn't always include the same fields.

## Can't get data for expression

This error occurs when the Edit Fields (Set) node can't retrieve the data referenced by an expression. This happens when n8n tries to find an item through [item linking](/data/data-mapping/data-item-linking/) but runs into problems.

For example, this JSON references the parameters of the input data. This error will display if you test this step without connecting it to another node:

```javascript
{
"my_field_1": {{ $input.params }}
}
```

To troubleshoot this problem, see the [item linking errors](/data/data-mapping/data-item-linking/item-linking-errors/) page to understand how to reference data from nodes that don't include pairing information.

## Invalid syntax

This error occurs when you use an expression in your Edit Fields (Set) node configuration that has a syntax error.

For example, the expression in this JSON includes a trailing period, which results in an invalid syntax error:

```javascript
{
"my_field_1": "value",
"my_field_2": {{ $('If').item.json. }}
}
```

To resolve this error, check your [expression syntax](/code/expressions/) to make sure they follow the expected format.

--8<-- "_snippets/integrations/referenced-node-unexecuted.md"
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4
title: Edit Fields (Set)
title: Edit Fields (Set) node
description: Documentation for the Edit Fields node in n8n, a workflow automation platform. Includes guidance on usage, and links to examples.
contentType: integration
priority: critical
---

# Edit Fields (Set)
# Edit Fields (Set) node

Use the Edit Fields node to set workflow data. This node can set new data as well as overwrite data that already exists. This node is crucial in workflows which expect incoming data from previous nodes, such as when inserting values to Google Sheets or databases.

Expand Down Expand Up @@ -34,7 +34,9 @@ If you don't want to use expressions:

You can do this for both the name and value of the field.

<!-- vale Vale.Spelling = NO -->
![A gif showing the drag and drop action, as well as changing a field to fixed](/_images/integrations/builtin/core-nodes/set/drag-drop-fixed-toggle.gif)
<!-- vale Vale.Spelling = YES -->

### Keep Only Set Fields

Expand Down Expand Up @@ -240,6 +242,6 @@ You get this output:
]
```

## Common issues



For common questions or issues and suggested solutions, refer to [Common Issues](/integrations/builtin/core-nodes/n8n-nodes-base.set/common-issues/).
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ nav:
- integrations/builtin/core-nodes/n8n-nodes-base.crypto.md
- integrations/builtin/core-nodes/n8n-nodes-base.datetime.md
- integrations/builtin/core-nodes/n8n-nodes-base.debughelper.md
- integrations/builtin/core-nodes/n8n-nodes-base.set.md
- Edit Fields (Set):
- Edit Fields (Set): integrations/builtin/core-nodes/n8n-nodes-base.set/index.md
- Common issues: integrations/builtin/core-nodes/n8n-nodes-base.set/common-issues.md
- integrations/builtin/core-nodes/n8n-nodes-base.editimage.md
- Email Trigger (IMAP): integrations/builtin/core-nodes/n8n-nodes-base.emailimap.md
- Error Trigger: integrations/builtin/core-nodes/n8n-nodes-base.errortrigger.md
Expand Down
Loading