Data Converter
Actions49
- Base64 Actions
- Binary Actions
- Encoding Actions
- Format Actions
- HTML Actions
- String Actions
Overview
The node provides a variety of string transformation operations under the "String" resource, including an operation to remove special characters from text. The "Remove Special Characters" operation cleans input text by stripping out characters that are not letters or numbers, with options to preserve spaces, numbers, filename-safe characters (dots, hyphens, underscores), and file extensions.
This node is useful in scenarios where you need to sanitize or normalize text data, such as preparing filenames, cleaning user input, or generating URL-friendly strings. For example, it can be used to clean up product names before saving them to a database or to prepare strings for use in URLs or file paths.
Properties
| Name | Meaning |
|---|---|
| Input Data | The text string to process and remove special characters from. |
| Binary Property Name | (Optional) Name for the output binary property if the output is binary data (not applicable here). |
For the "Remove Special Characters" operation specifically, the following options can be set when using "Apply Multiple Operations":
| Option Name | Meaning |
|---|---|
| Keep Spaces | Whether to keep spaces in the output text (default: true). |
| Keep Numbers | Whether to keep numeric characters in the output text (default: true). |
| Keep Filename Characters | Whether to keep dots, hyphens, and underscores (useful for filenames) (default: false). |
| Keep File Extension | Whether to preserve the file extension (last dot and everything after) when removing special chars (default: false). |
Output
The node outputs a JSON object with a result field containing the transformed string after removing special characters according to the selected options.
Example output JSON:
{
"result": "CleanedText123"
}
If the node is configured to output binary data (not typical for this operation), it would provide the processed data in a binary property named as specified by the user.
Dependencies
- No external services or API keys are required.
- The node relies on internal utility functions for string manipulation.
- No special environment variables or n8n configurations are necessary.
Troubleshooting
- Empty Result: If the output string is empty, verify the input text and the options chosen (e.g., if all characters are special and options exclude keeping spaces/numbers).
- Unexpected Characters Remaining: Check the options for keeping filename characters or spaces; these affect which characters remain.
- Error Messages: Errors typically relate to missing required input data. Ensure the "Input Data" property is provided and is a valid string.
- Binary Output Misconfiguration: If binary output is enabled but no binary data is generated, check that the operation supports binary output (this operation does not).
Links and References
- n8n Documentation - String Operations
- General info on string sanitization: https://en.wikipedia.org/wiki/String_sanitization