nodes / builtin / datatransformation
Text / Formatter
Transform text: case, trim, pad, replace, split, slugify, extract, count, encode and decode
Clean up, reshape, search or encode a piece of text, without writing code.
What it does
Section titled “What it does”You pick an Operation and point Text at your value, for example {{ $input.title }}. The node then does one thing to that text:
- Change case: Uppercase, Lowercase, Title Case, camelCase, snake_case, kebab-case. The last three understand spaces, punctuation and existing camelCase, so
Order ID numberbecomesorder_id_number. - Shape: Trim (remove spaces at both ends), Pad, Replace, Split, Join, Slugify, Truncate, Default if empty.
- Find: Extract emails, Extract URLs, Extract numbers, Extract phone numbers return every match, not just the first.
- Count: Word count, Character count. An emoji or accented letter counts as one character.
- Encode or Decode with a Scheme: Base64, URL (whole URL), URI component, HTML entities or Hex. Accented letters and emoji survive a round trip.
Slugify turns Héllo, Wörld! into hello-world, which is handy for file names and links.
When to use it
Section titled “When to use it”- Tidy scraped text before you save or send it: trim it, fix its case, or replace a placeholder.
- Pull every email address or link out of a page’s text.
- Build a file name or link from a title with Slugify.
- Encode a value for a link with URI component, or decode Base64 text from an API.
- For patterns of your own and named fields, use Regex instead.
Inputs and settings
Section titled “Inputs and settings”22 choices · pick operation to see its settings
Settings for Uppercase
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Lowercase
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Title Case
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for camelCase
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for snake_case
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for kebab-case
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Trim
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Slugify
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Extract emails
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Extract URLs
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Extract numbers
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Extract phone numbers
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Word count
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Character count
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
Settings for Pad
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Target Length | Number | Pad until the text reaches this many characters. Default: 0 |
| Pad With | Text | The characters repeated to fill the space. Default: |
| Pad Side | Choice | Which end to pad. Options: Start, End. Default: Start |
Settings for Replace
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Find | Text | The text or pattern to look for. |
| Replace With | Text | The text put in place of each match. |
| Treat Find As Regex | Toggle | Read the Find field as a regular expression. Default: Off |
| Regex Flags | Text | Flags for the pattern, such as gi. Default: g |
Settings for Split
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Separator | Text | The string to split on. Empty splits into characters. Default: , |
Settings for Join
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Separator | Text | The string placed between joined items. Default: , |
Settings for Truncate
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Maximum Length | Number | Keep at most this many characters. Default: 20 |
| Ellipsis | Text | Appended when the text is shortened. Default: … |
Settings for Default if empty
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Default Value | Text | Returned when the text is empty or only whitespace. |
Settings for Encode
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Scheme | Choice | Which encoding to convert to or from. Options: Base64, URL (whole URL), URI component, HTML entities, Hex. Default: Base64 |
Settings for Decode
| Setting | Type | What it does |
|---|---|---|
| Text | Value | The text to transform. Bind an upstream value with {{ }}. |
| Scheme | Choice | Which encoding to convert to or from. Options: Base64, URL (whole URL), URI component, HTML entities, Hex. Default: Base64 |
Showing settings for Uppercase
Every operation has Operation (default Uppercase) and Text. Some show extra settings:
| Operation | Extra settings |
|---|---|
| Pad | Target Length (default 0), Pad With (default a space), Pad Side (Start or End) |
| Replace | Find, Replace With, Treat Find As Regex (default off), Regex Flags (default g) |
| Split | Separator (default ,). Empty splits into single characters. |
| Join | Separator (default ,), placed between the joined entries |
| Truncate | Maximum Length (default 20), Ellipsis (default …), added only when the text is cut |
| Default if empty | Default Value, returned when the text is empty or only spaces |
| Encode, Decode | Scheme (default Base64) |
- Replace without regex replaces every occurrence of Find. With Treat Find As Regex on, the default
gflag also replaces every match; addi(gi) to ignore case. - Join expects Text to be a list, such as
{{ $input.tags }}. A single text value comes back unchanged. - URL (whole URL) leaves
:/?#&=alone, so it is safe on a full address. URI component escapes them too; use it for one value inside a link.
Outputs
Section titled “Outputs”-
Output
The field depends on the operation:
result: the new text for case, shaping, Encode and Decode operations. For Split it is a list.matches: the list of everything found by an Extract operation. It is an empty list when nothing matched.count: the number from Word count or Character count.
The output holds only that field. To keep the original data next to it, read it from the earlier node with an expression such as {{ $('HTML Extract').title }}.
Dependencies and credentials
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”- Get Selected Text with Output field name
selectionreads the text you highlighted on a page. - Text / Formatter with Operation Extract emails and Text
{{ $input.selection }}. Every address comes back inmatches. - A second Text / Formatter with Operation Join, Text
{{ $input.matches }}and Separator,gives one line of addresses inresult. - A Slack node posts
{{ $input.result }}.
Common issues
Section titled “Common issues”- “Invalid base64: could not decode the input as UTF-8 text.” The text is not Base64, or it is Base64 of a file rather than text. Check that you picked the right Scheme.
- “Invalid hex: expected an even number of hex digits.” or “Invalid hex: contains non-hexadecimal characters.” The text is not a clean hex string. Remove spaces or prefixes such as
0x. - “Invalid URL encoding: malformed percent-escape sequence.” (or Invalid URI component). A
%in the text is not followed by two hex digits. Check the text was really encoded. - Replace fails with an invalid regular expression error. Treat Find As Regex is on and Find has a syntax error, or Regex Flags holds a letter that is not a flag. Turn the option off to replace plain text.
matchesis empty. Nothing in the text looks like an email, link, number or phone number. Phone numbers must be at least seven characters long and start and end with a digit; links must start withhttp://orhttps://.
Related nodes
Section titled “Related nodes”- Regex: your own patterns, with named groups as fields.
- Edit Fields: put the result back next to the other fields.
- Crypto: hashes and signatures rather than encodings.