Skip to content

String to Array

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.

ParameterTypeRequiredDescription
inputKeystringYesThe text string to split.
outputKeystringNoName of the field where to save the resulting array. Default data.
separatorTypestringNoSeparator type: comma, semicolon, newline, tab, custom. Default uses fallback [\n,].
customSeparatorstringNoCustom separator when separatorType is custom. Supports escape sequences: \\n, \\r, \\t.
{
"nextModule": "siguiente_modulo",
"data": {
"result": ["item1@email.com", "item2@email.com", "item3@email.com"]
}
}
{
"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 separatorType is 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
  • objectArrayConverter (conversions between object and array)
  • iterador (iterate over the resulting array)
  • mapFunction (apply transformation to each array element)