Clean and Transform Text with the Text Formatter Action
The Text Formatter action modifies text so it looks right before you send it or save it. Choose a transformation, point it at a field, and use the result in later steps.
Set it up
- Open Automation > Workflows and click +.
- Add Text Formatter and give it a specific name.
- Choose an Action Type.
- Select the field to format, such as a contact, user, message or business detail. Other options appear depending on the type.
- Save, then insert the output in later steps via the variable picker.
Action types
- Upper Case, Lower Case, Title Case, Capitalize: change letter case.
- Default Value: supply a replacement when the input is empty, for example "there" when a first name is missing.
- Trim: shorten text by a maximum length, remove characters from the start, or end with an ellipsis.
- Trim Whitespace: remove spaces at the beginning and end.
- Replace Text: swap every occurrence of one word or phrase for another.
- Find: return the position of a value in the text, or -1 if absent.
- Word Count and Length: count words or characters.
- Split Text: divide by a separator and return a chosen segment, such as the first or last.
- Remove HTML Tags: convert HTML to plain text.
- Extract Email and Extract URL: pull the first email address or link out of a block of text.
Handy examples
- Greet people with Title Case: "jANE" becomes "Jane".
- Use Default Value so "Hi , welcome" never goes out with a blank name.
- Split a full address string to get a city.
- Strip HTML from a form response before texting it.
- Trim a long note to 160 characters for an SMS.
Tips
- Name each formatter by purpose, since you may use several in a row.
- Chain formatters: trim whitespace first, then change case.
- Test with messy real examples, including empty values.
- For dates use the Date/Time Formatter; for numbers use the Number Formatter.
Good to know: The same formatter can read contact, user, message, business and even call details, so you can tidy almost any text value.
Was this article helpful?
