String Operation
๐ฏ Purposeโ
The String Operation node provides text manipulation capabilities for cleaning, formatting, and restructuring text data. It supports operations like joining arrays, splitting text, replacing content, extracting substrings, trimming whitespace, and changing case. This makes it a versatile utility node for preparing text data in automation workflows.
๐ฅ Inputsโ
- Text / Array Input (String or Array, Required): The text or array of text values from a previous node to be transformed.
๐ค Outputsโ
- Transformed Text: A new property containing the manipulated text according to the selected operation.
- Structured Output: Can either include all original data plus the new property, or only the transformed text, depending on output settings.
โ๏ธ Parametersโ
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| String Operation | Dropdown | No | Join (array to string) | Operation to perform. Options: Join, Replace, Split, Substring, Trim, Upper case, Lower case. |
| Property Name | String | Yes | (empty) | Property containing the source text or array. |
| Delimiter | String | No | (empty) | Separator used when joining arrays into a single string. |
| Find | String | No | (empty) | The text pattern to find for replacement. |
| Replace By | String | No | (empty) | The text to replace matches with. |
| Split Delimiter | String | No | (empty) | The delimiter used to split strings into arrays. |
| Substring Start | Number | No | 0 | Start index for substring extraction (0-based). |
| Substring End | Number | No | 2 | End index for substring extraction (exclusive). |
| Option | Dropdown | No | Original with appended result column | Controls output: keep original data with result, or return only the result. |
| Result Property Name | String | No | string_result | Name of the property containing the transformed text. |
๐ก Example Usageโ
Customer Data Standardizationโ
- Setup: Replace unwanted characters in
phone_numberand name resultclean_phone_number. - Result: Standardized phone numbers (e.g.,
"1234567890").
Product Description Summariesโ
- Setup: Substring
product_descriptionfrom 0โ100 โshort_description. - Result: Short previews for mobile app listings.
Email List Managementโ
- Setup: Split
customer_tagsby","โtag_array. - Result:
"premium,loyal,newsletter"โ["premium", "loyal", "newsletter"].
Address Formattingโ
- Setup: Join address parts array with
", "โformatted_address. - Result:
"123 Main St, Springfield, IL 62701".
๐ Best Practicesโ
- Use Trim before other operations to clean unwanted whitespace.
- Chain multiple String Operation nodes for complex transformations.
- Prefer Return result column only if the original data is not needed downstream.
- Always test delimiters and substring indices with sample data.
- Use descriptive output names like
clean_email,formatted_phone,short_title.
๐งช Test Casesโ
- Given:
["Alice", "Bob", "Charlie"]with Join,Delimiter = ", "โ
Expected:"Alice, Bob, Charlie" - Given:
"Hello World"with Replace,find = "World",Replace By = "Threo"โ
Expected:"Hello Threo" - Given:
"red,blue,green"with Split,delimiter = ","โ
Expected:["red", "blue", "green"] - Given:
"ProductCode12345"with Substring,start = 0,end = 11โ
Expected:"ProductCode" - Given:
" spaced text "with Trim โ
Expected:"spaced text"