Text is the central point of many Zapier automations. In fact, many of your workflows will focus on moving text data from one app to the other. Often, to make the workflow a success, you’ll need that data changed before you send it to its final destination. That’s where the Zapier Text event can help you out.
When to Use the Text Step Inside Zapier Formatter
The text step is one of the most useful Zapier automations. With over 20 transformations to choose from, you can perform a variety of different text operations.
First, you can use it to manipulate the text data directly. You can capitalize the text, set the case to title, uppercase, or lowercase. You can even set Zapier to pluralize the nouns.
These automations come in handy especially whenever you need to reformat text (for example, capitalize incoming titles or names) or split it. In fact, splitting text is probably the most popular Zapier formatter text automation.
It’s useful especially when you can’t extract the data using any of the other Zapier steps. Speaking of which – extracting different types of text is the second common usage of the text Formatter step.
It allows you to extract things like phone numbers, email addresses, URLs, or custom patterns. This transformation comes in handy especially when you get poorly customer formatted data and need to extract their email address or a phone number.
Another handy automation you can use is create a default value for future Zaps. This helps prevent errors in steps that don’t let you set one.
Other things you can do is convert HTML to markdown (or the other way around), or special characters to ASCII.
How to Use Text by Zapier Formatter
To create a Zap using the text by Zapier formatter automation, first, select Formatter from the list of available apps:
Then, you want to select the Text event from the list of available Formatter events:
Now, you’ll be able to pick one of the available transformations:
A full list of available transformations in the text step is pretty long and includes more than 25 positions:
- Capitalize text
- Convert HTML to markdown
- Convert markdown to HTML
- Convert special characters to ASCII
- Set default value
- Extract email address
- Extract number
- Extract pattern
- Extract phone number
- Extract URL
- Find position of a value in the text
- Check text length
- Set text to lowercase
- Pluralize text
- Remove HTML tags
- Replace text
- Split text
- Execute a spreadsheet-style formula
- Generate a random superhero name
- Set text to title case
- Trim whitespace
- Truncate text
- Decode URL
- Encode URL
- Set text to uppercase
- Count the number of words
Let’s go over the most important ones to see how you can add them to your automation workflow.
How to Capitalize Text in Zapier?
First, select “Capitalize” from the drop-down list of available transformations inside Zapier Formatter.
Then, pick the input data that you want to capitalize. In our example, we’ll try to capitalize “john adam smith”. As with most examples you’ll see in this article, we’re pulling data from a Google sheet:
Capitalizing improperly entered customer names is a common use case for this Zapier automation.
It’s especially useful when trying to keep your database accurate or personalizing client communication.
And here’s the result:
How to Use Zapier to Convert HTML to Markdown?
To get started, select the “Convert Markdown to HTML” option inside Zapier Formatter > Text event:
Next, select the HTML code that you want to convert. The beauty of this automation is that you don’t have to perform any manual work. Simply select the data source and you’re good to go:
Of course, you can then use Zapier to upload this Markdown to its destination, automating the entire process.
How to Convert Markdown to HTML in Zapier?
Here’s the reverse to the previous step. First, find the “Convert Markdown to HTML” step inside Formatter > Text:
Then simply input data source with your Markdown code:
And that’s it! Below you can see a sample markdown turned into HTML.
If you’d like to see how the above code’d look like as a Markdown, scroll up to see the output of the previous step.
How to Convert Special Characters to ASCII?
Next, let’s look at how you can convert all special characters to ASCII using Zapier Formatter. First, select “Convert ASCII” inside Formatter’s Text event:
Next, pick the input text that you want to reformat:
Please note that you don’t have to separate special characters from the ASCII ones. Zapier Formatter can distinguish between the two and will focus exclusively on those that need converting.
And here’s the output:
As you can see in the output, the conversion is not 100% accurate. However, I’ll admit that the provided sample was a very tricky one. The automation should work fine most of the time.
How to Set Default Values for Blank Fields in Zaps
Setting a default value is useful in a situation where the data source doesn’t always provide a value. In this case, setting a default inside your workflow will prevent your Zap from failing. First, find “Default Value” inside the Text event transformation list:
Next, pick the data source. This is the source that you want to move the data from to the next step. The default value is what you want to send to the next step when there’s no input data.
For this test, we set the input text to “This text is visible when data is provided”:
And here’s an example output when no data is provided. Because we set the default value to “This text is visible when no data is provided”, this is what’s visible in the output:
A useful case for this step are any types of calculations where you divide or multiply some data by a variable which, when not provided, is substituted with a constant number.
How to Extract an Email Address From Text?
Sometimes you’ll not be able to pull clean email data.
In this case, rather than trying to clean this data manually (or with regex), you may use Formatter’s “Extract Email Address”:
Next, simply connect the data source that you want to pull the data from:
And here’s the output:
Please note that this step can only return one email at a time. It also has to be formatted correctly.
If your data is hard for this step to read, you may need to try using the Code step with python to extract the data you need.
How to Extract a Number
This step is similar to extracting email addresses – the difference is, Zapier will be looking for numerical data.
First, select “Extract Number” in the text event:
Next, add the data source that you want to extract the data from:
In our example, we added a simple piece of text and a string of “123456789”. Here’s the output:
Please note that Zapier will only return the first numerical value that it comes across. For more complex extraction, you may try the “extract a pattern step”. Which is the next step we’ll be talking about:
How to Extract a Pattern?
This step is perfect if you need to extract more complex pieces of information. To get started, first select the “Extract Pattern” step inside Zapier Formatter:
Next, it’s time to set up the automation. Compared to the previous steps, it’s a little bit more complex.
First, you’ll be asked to select the input data source.
Next, you want to enter the pattern that you’ll be looking for.
Please note that Zapier is using Python Regular Expressions. Other regular expressions may not work correctly.
Here’s sample regex we’ll use:
\+\d\d?\s\d{3}-\d{3}-\d{3}
The regex lets you search for a phone number. Please note that you can build way more advanced expressions for finding phone numbers. The one we’re using here is a simple example to explain this automation.
The \+ ensures that we search for the + character (because it’s a special character in regex, we had to escape it with \)
d\d\? means we’re looking for one or two numbers after the +. The ? means we’re looking for zero or one occurrence of what’s on the left of ?. This helps us find either single or double digit country codes.
\s is used for space.
\d{3} means we’re looking for three digits.
The above regex lets you find a phone number in a format +00 123-456-789 – and that’s exactly what we’ll be looking for.
Next, you can select yes or no for Match All. If you pick yes, Zapier will return all items that match the regular expression (it’ll return it as line items).
MULTILINE allows ^ and $ anchors to match starts and ends of lines when you use \n in regular expressions.
The DOTALL allows the dot wildcard to match across lines when \n is used as line break. Selecting no means the dot will not match patterns beyond the line break.
Lastly, IGNORECASE lets you set your Zap to ignore character case when matching.
And here’s what a sample setup looks like:
Here’s the input text that we used in the “Input”, together with the pattern:
And the output – as you can see, the Zap had no problems with returning the phone number.
Of course, this automation can be used for returning a lot more advanced data. And if you need to return a simple phone number – you can try the “Extract Phone Number” step.
Which is exactly what we’ll be doing in the next step.
How to Extract a Phone Number from Text?
Now, let’s look at a simpler way to extract a phone number using Zapier. First, find the “Extract Phone Number Step” inside Zapier formatter text event:
Next, enter input data and choose the phone number format. Please note that this automation is unable to return all kinds of phone numbers and only works with a few formats.
To return the format that we used in the previous step, you need to use the “Universal 2” format:
And here’s the output.
That’s why, if you need to extract phone numbers in different formats, it’s better to build an advanced regular expression.
How to Extract a URL?
To extract a URL using Zapier, find “Extract URL” inside Zapier formatter:
Next, simply pick the data source that you want to extract the URL from.
Here’s the text that we’re using in this example. As you can see, there are additional characters immediately before and after the URL.
Interestingly, Zapier had no problem with extracting the URL:
However, please note that the Zap may be unable to extract more complex URLs, especially if the URL comes with additional code. In this case, a regex may be a better alternative.
Of course, if you know the URLs you’re looking for (and the data source), there’s no reason to overcomplicate your setup. Especially if you’ve already tested things and know that Zapier can extract the data.
How to Find the Position of a Value?
Sometimes, you may be interested in finding the position of a given value inside a given string of text. To find it, first select “Find” inside Zapier Formatter text event:
Next, select the data source and the value that you’re looking for.
Please note that this automation will only look for the value for as long as it finds its first occurrence.
That’s why, if you know the value is also present early in the string, you may want to set Zapier to skip a number of characters:
And here’s the output. As you can see, the first “s” in “this is a sample…” is at the 4th position – but we selected to skip the first 5 characters.
How to Check the Length of a Value or Sentence in Zapier?
Thanks to Zapier, you don’t need to code to check the length of a value or sentence either. Instead, simply select “Length” inside Zapier Formatter:
For this example, we’ll use the following: “This text is 32 characters long”. Which is just as it says, 32 characters long.
And here’s the output value:
This step is especially common in workflows where you need to verify the length of incoming values. In this case, you can use Zapier paths to create two scenarios – for when the value exceeds, and doesn’t exceed the limit.
How to Set Text to Lowercase in Zapier?
Editing text with Zapier is super simple. To set the text to lowercase, first, you want to pick “Lowercase” from inside Zapier Formatter:
Next, select the data source that you want to edit.
In this example, we input “THIS TEXT IS ALL UPPERCASE”. And here’s the output:
How to Pluralize Text in Zapier?
Next, here’s how you can pluralize text in Zapier:
As you can see, we input a few nouns to see how the Zap will behave:
Unfortunately, it was able to pluralize only the last noun in the text:
As you can see, while this step works correctly, it’s unable to pluralize more than one noun at once.
How to Remove HTML Tags in Zapier?
And what if you want to clean text from HTML tags? To do that, select the “Remove HTML Tags” transformation:
Next, all you need is to provide the input data source:
In this example, we used the following HTML text:
<!DOCTYPE html> <html> <body> <h1>The First Heading</h1> <p>The first paragraph.</p> <a href=”https://www.example.com”>This is a link</a> </body> </html> |
And here’s what it looks like once we stripped HTML tags:
How to Replace Text or String in Zapier?
Next, let’s look at how you can replace text or string in Zapier. This step is very useful especially when you receive a string that’s poorly formatted or where certain characters got replaced with incorrect ones.
It can also be used to automatically replace dummy data in personalized communication. How does it work?
First, find “Replace” inside the text event:
Next, select the input data source and the character (or string) that you’re looking for and want to replace.
In our case, we’ll replace space with <this-was-space> string. It’s silly but it’s an easy way of showing you how the Zap works.
Please note that Zapier uses special characters for space, tab, newline and return. They’re [:space:], [:tab:], [:newline:], and [:return:] respectively.
And here’s the output:
How to Split Text in Zapier?
Text splitting is one of the most popular Zapier text formatter automations. It’s also one of the easiest ways to pull data out of a string.
Simply split the incoming text and then pick the right data pieces and move them to another app.
To get started, select Split Text inside Zapier Formatter.
Next, enter the text that you want to split and the separator. In our example, we entered the text manually. Of course, just like any other Zapier automation, this transformation accepts data input from other apps.
Then, select the separator that you want to split the text on. In our example, we picked space.
Lastly, select segment index. You can choose to return the first, second, last, or second to last data piece. You can also choose to return all as line items or as separate fields. We picked the former:
And here’s the output. As you can see, Zapier returned a list of words that made up the input sentence.
How to Use a Spreadsheet-Like Formula on Text in Zapier?
One of the most powerful Zapier Formatter automations is the one that allows you to use spreadsheet-like formulas right inside Zapier.
Interestingly Zapier allows you to use those formulas for both text and number formatter automation. Of course, the formulas that you create will differ.
To get started, first scroll down to “Spreadsheet-Style Formula” inside Zapier Formatter.
Next, enter the formula that you want Zapier to execute. Keep in mind that you’re free to use any data from previous steps that you want.
In our simple example, we’re comparing two email addresses – one from Airtable, another from Mailchimp. If the addresses are identical, the Zap will return “same”. Otherwise, it’ll return “different”.
And, as you can see, the addresses are the same:
Naturally, you can create as advanced formulas as you want – but keep in mind that you can only use those that accept text. Visit this page to view a list of all Zapier spreadsheet-like formulas.
How to Return a Random Superhero Name in Zapier?
This automation is pretty silly – but since it’s there, we had to add it to our ultimate zapier formatter guide. So, how do you turn your name into a Superhero one?
First, find the Superhero name transformation inside Zapier Formatter. It comes right below the Spreadsheet-Style Formula.
This is interesting considering the latter is one of the most advanced Formatter steps.
Next, select the data source that you want to turn into a Superhero.
For this article, I decided to just input my name manually.
And here’s my superhero name: “Astro Shadow”. Interestingly, Zapier returned the same name each time I tried this setup. This means that the algorithm that generates the name is not random.
How to Format Text to Title Case in Zapier?
If you need to change text to title case, you can do so easily with Zapier. First, find the “Titlecase” transformation inside Zapier formatter:
Next, simply enter the data source with the text that you want to format:
In this article, we used “change this text to titlecase”. As you can see, Zapier correctly change the case of each word:
This step might seem similar to Capitalization. However, the main difference is that it doesn’t capitalize all words, sticking to the title case rules.
How to Trim Whitespace in Zapier?
Trimming whitespace lets you remove unnecessary whitespace and spaces from text. To get started, first find the “Trim Whitespace” step inside Formatter:
Next, select data source with the text that you want to format:
Here’s the text that we used in this example:
Remove all whitespaces with Zapier: This is a sample text Remove them from both sides. Hello There Nice to meet you |
And here’s the output. I highlighted the text on purpose so that you can see that all unnecessary whitespace was removed:
How to Truncate Text Using Zapier?
Next, let’s look at how you can Truncate text using Zapier.
This step is especially useful if the app that you want to send the data to can accept a limited number of characters.
To set it up, first, you need to select “Truncate” inside Zapier Formatter:
Next, you want to connect the input data source and set the max length of the output string.
Note that you can choose to skip certain characters, as well as select to append Ellipsis.
For our example, we chose to append the ellipsis and set the length of “Let’s truncate this short sentence to 20 characters.”
Here’s the output:
How to Decode and Encode URLs Using Zapier?
URL decoding allows you to turn encoded URL characters into standard ASCII characters. Encoding allows you to change some of URL characters into one or more “triplets”.
Each triplet is made up of a “%” sign followed by two hexadecimal digits.
Both Encode and Decode URL are available inside Zapier Formatter text Event.
Here’s URL Encode:
And URL Decode:
The two operations are very similar (one is the reverse of the other). So, let’s look at how you can decode a URL. Once you select the right transformation, you’ll be asked to provide the input URL.
For this article, I entered one manually:
You can also select to convert “+” to spaces. This is useful if you want to pull separate words from the URL.
And here’s what the output URL looks like:
How to Format Text to Uppercase in Zapier?
Now, let’s look at how you can convert text into Uppercase using Zapier. First, select Uppercase from the list of available transformations:
Then, you’ll be asked to select input data. In this uppercase transformation we re-used a short sentence that we used in one other Zap:
And here’s the result. As you can see, all characters were turned to uppercase.
How to Count Words in Zapier?
The word count automation is the last of all transformations available in the Zapier Formatter text event.
To use it, scroll down to the very bottom of the transformation lists and select “Word Count”:
Then, select the text that you want to check. In our example, we didn’t pull it from a third-party app. Rather, we just input it manually just to show you how the Zap works.
And here’s the output:
Getting the Most out of Zapier Formatter Text Event
Congratulations! You’ve just reviewed all available Zapier text Event transformations. Now you can perform dozens of operations on the text data – all of that automatically!
Of course, as you could read in this article (and, as you’ll find out as you work with Zapier), Zapier formatter has certain limitations.
For example, sometimes, in some rare cases, Zapier Formatter may return duplicate data.
If that’s the case, you may need to use the code step – like in our guide to removing duplicate Zapier data with Python.
Also, there’s a lot more you can do with Zapier Formatter itself. To learn more about Zapier formatter, be sure to check out:
- Introduction to Zapier Formatter
- Guide to manipulating date and time in Zapier
- Guide to manipulating numbers in Zapier
- Guide to Zapier Formatter Utilities
And, don’t forget that you don’t have to do all the Zapier work yourself. If you’d like a professional to look at your Zapier setup or create a workflow, let’s talk.
Head over to this page, schedule a Zapier discovery call, and let’s talk about your automation needs.
Hey, I’m Jacek. I’m the founder and Chief Automator at Clickleo.com
I’m on a mission to help you use automation to reclaim your time and achieve more in your business.
You can find out more about me – and why I started Clickleo – over on this page
Comments
Powered by WP LinkPress