String to Array
Description
Section titled “Description”This module splits a text string into an array of elements using a configurable separator. It supports predefined separators (comma, semicolon, line break, tab) and custom separators. The resulting elements are trimmed of whitespace and empty elements are removed. The result is stored in a configurable field within the output data, preserving the original data. It is useful for processing lists of email addresses, IDs, SKUs or other data that arrives as separated text.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| inputKey | string | Yes | The text string to split. |
| outputKey | string | No | Name of the field where to save the resulting array. Default data. |
| separatorType | string | No | Separator type: comma, semicolon, newline, tab, custom. Default uses fallback [\n,]. |
| customSeparator | string | No | Custom separator when separatorType is custom. Supports escape sequences: \\n, \\r, \\t. |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "result": ["item1@email.com", "item2@email.com", "item3@email.com"] }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "inputKey": "juan@email.com, ana@email.com, pedro@email.com", "outputKey": "emails", "separatorType": "comma"}- Resulting elements are trimmed of leading and trailing whitespace
- Empty elements are automatically removed from the resulting array
- The separator is used as a regular expression for greater flexibility
- If
separatorTypeis not specified, a fallback that splits by line breaks and commas is used - Original input data is preserved in the output along with the new field
- Supports escape sequences in custom separators:
\\n,\\r,\\t
Related Nodes
Section titled “Related Nodes”- objectArrayConverter (conversions between object and array)
- iterador (iterate over the resulting array)
- mapFunction (apply transformation to each array element)