Edit Fields (Set)#
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.
Node parameters#
The are the settings and options available in the Edit Fields node.
Mode#
You can either use Manual Mapping to edit fields using the GUI or JSON Output to write JSON that n8n adds to the input data.
Fields to Set#
If you select Mode > Manual Mapping, you can configure the fields by dragging and dropping values from INPUT.
The default behavior when you drag a value is:
- n8n sets the value's name as the field name.
- The field value contains an expression which accesses the value.
If you don't want to use expressions:
- Hover over a field. n8n displays the Fixed | Expressions toggle.
- Select Fixed.
You can do this for both the name and value of the field.
Keep Only Set Fields#
Enable this to discard any input data that you don't use in Fields to Set.
Include in Output#
Choose which input data to include in the node's output data.
Node options#
Use these options to customize the behavior of the node.
Include Binary Data#
If the input data includes binary data, choose whether to include it in the Edit Fields node's output data.
Ignore Type Conversion Errors#
Manual Mapping only.
Enabling this allows n8n to ignore some data type errors when mapping fields.
Support Dot Notation#
By default, n8n supports dot notation.
For example, when using manual mapping, the node follows the dot notation for the Name field. That means if you set the name in the Name field as number.one
and the value in the Value field as 20
, the resulting JSON is:
1 |
|
You can prevent this behavior by selecting Add Option > Support Dot Notation, and setting the Dot Notion field to off. Now the resulting JSON is:
1 |
|
Templates and examples#
Arrays and expressions in JSON Output mode#
You can use arrays and expressions when creating your JSON Output.
For example, given this input data generated by the Customer Datastore node:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
Add the following JSON in the JSON Output field, with Include in Output set to All Input Fields:
1 2 3 4 5 6 7 8 9 |
|
You get this output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|