Overview
This node, named "Example Node," is a basic transformation tool designed to add or overwrite a string property in each input item’s JSON data. It takes an input string from the user and assigns it to the myString field of every incoming data item. This node is useful when you want to annotate or tag your data items with a consistent string value, such as adding a label, note, or identifier.
Practical examples:
- Adding a status label like
"processed"or"pending"to all items before passing them downstream. - Injecting a fixed comment or remark into each data record for tracking purposes.
- Setting a default value for a missing field across multiple items.
Properties
| Name | Meaning |
|---|---|
| My String | The string value to assign to the myString field in each item's JSON data. Users can enter any text here. |
Output
The node outputs the same number of items as it receives, but each item’s JSON data will have a new or updated property called myString set to the user-defined string value.
Output structure example:
[
{
"json": {
"myString": "User provided string",
// ... other original properties
}
},
// ... more items
]
No binary data output is produced by this node.
Dependencies
- No external services or API keys are required.
- No special environment variables or n8n configurations are needed.
Troubleshooting
Common issues:
- If the input data is empty or not properly formatted, the node will still run but simply add the
myStringproperty to whatever JSON exists. - Errors may occur if the input data is malformed or inaccessible.
- If the input data is empty or not properly formatted, the node will still run but simply add the
Error messages:
- If an error occurs during processing an item, and the node is configured to continue on failure, the error details will be attached to that item’s output under an
errorproperty. - Otherwise, the node throws an error indicating which item caused the failure, helping users identify problematic data.
- If an error occurs during processing an item, and the node is configured to continue on failure, the error details will be attached to that item’s output under an