Text
Text utilities in one step: render a Handlebars template, split text into a list, find and replace, extract values with a regular expression, change case, and trim whitespace.
Parameters
Which fields appear depends on the Operation.
| Name | Shown for | Default | Description |
|---|---|---|---|
Operation (operation) | all | Template (Handlebars) | template, split, replace, regexExtract, case, trim. Required. |
Template data (data) | template | — | The object the template reads from, e.g. {{ $nodes['Get Order'] }}. |
Template (template) | template | Hello {{name}}! | A Handlebars template. Stored verbatim — its {{ }} are Handlebars, not Blokkio expressions. Max 100,000 characters. |
HTML-escape values (htmlEscape) | template | false | Escape &, <, >, quotes in inserted values. Turn on when building HTML from untrusted data. |
Text (value) | all except template | — | The text to work on. |
Separator (separator) | split | , | Used exactly as typed (spaces count). \n, \t and \r mean new line, tab and carriage return. Empty splits into single characters. |
Trim parts (trimParts) | split | true | Trim whitespace around each part. |
Remove empty parts (removeEmpty) | split | true | Drop empty parts (after trimming). |
Find (search) | replace | — | Text (or regex) to find. Empty leaves the text unchanged. |
Replace with (replacement) | replace | — | Replacement. With a regex, $1 or ${name} insert a captured group. |
Find is a regular expression (useRegex) | replace | false | Treat Find as a regex. |
Case-sensitive (caseSensitive) | replace | true | For plain-text find only; for regex use the i flag. |
Regular expression (pattern) | regexExtract | — | The pattern, e.g. (?<user>[^@]+)@(?<domain>.+). Required. |
Group (name or number, optional) (group) | regexExtract | — | Return just this group. |
Return all matches (extractAll) | regexExtract | false | Return every match instead of the first. |
Regex flags (regexFlags) | replace, regexExtract | — | Any of i (ignore case), m (multi-line ^/$), s (. matches new lines), x (ignore pattern whitespace). g is accepted and ignored — replace always replaces every match. |
Case (caseType) | case | lower case | lower, upper, title, sentence, camel, pascal, snake, kebab. |
Regular expressions use .NET syntax (very close to JavaScript's; named groups are (?<name>…)) and time out after 2 seconds.
Ports
| Port | Description |
|---|---|
main (input) | The step(s) Text runs after. |
output | { result }, plus matches and count for regex extract. |
Output by operation
| Operation | result |
|---|---|
| Template | The rendered text. |
| Split | An array of strings. |
| Replace | The new text. |
| Extract with regex | The first match (or null), or an array of all matches with Return all matches. Also returns matches (always an array) and count. |
| Change case | The converted text. |
| Trim | The text without leading/trailing whitespace. |
What a regex match returns:
- with Group set — that group's text (
nullif it didn't take part); - else with named groups — an object of all named groups;
- else with numbered groups — the first group;
- else — the whole match.
{
"result": { "user": "ada", "domain": "example.com" },
"matches": [ { "user": "ada", "domain": "example.com" } ],
"count": 1
}
Case conversion examples for helloWorld-foo_bar: camel helloWorldFooBar, pascal HelloWorldFooBar, snake hello_world_foo_bar, kebab hello-world-foo-bar.
Example
Build an order confirmation email body:
- Operation: Template (Handlebars)
- Template data:
{{ $nodes['Get Order'] }} - Template:
With data { "id": 4417, "customer": { "firstName": "Ada" }, "lines": [ { "qty": 2, "name": "Mug" } ] } the result is:
Hi Ada,
Thanks for order #4417. You bought:
- 2 × Mug
Split a comma-separated tag string: Operation Split, Text {{ $trigger.body.tags }}, Separator , — "red, green, , blue" gives ["red", "green", "blue"].
Notes
- Handlebars built-ins such as
#each,#if,#unlessand#withare available. - Regex extract returns at most 10,000 matches.