Text functions

In this article, I’ll take you on a journey through Make.com’s text functions, showing you how to get creative with your data.

Whether you’re formatting text, turning it into Base64 code, or working your way through complex transformations, these functions make it a breeze.

So buckle up and join me as I uncover the magic of Make.com’s text tools and show you how to make your automation tasks both easier and more exciting!

Introduction to text functions

Text functions, also known as string or binary functions, are essential tools for manipulating text. Most people use it to capitalizing text, converting to lowercase or uppercase, and removing or replacing characters.

But you can also use functions like sha1() or base64() to encode or decode data, which is mostly interesting for techy people like programmers.

This is what the mapping panel looks like in your scenario;

text and binary functions in mapping panel in make scenario

All text functions explained

length

With the length() function you can figure out how long a text is.

length(Max)

= 3

In this case, Max is 3 characters long.

capitalize

The capitalize() function capitalizes the first letter of each word.

capitalize(Welcome to my website)

= Welcome To My Website

But it’s important to keep in mind that it leaves all the other letters alone.

capitalize(WELCOME to my webSITE)

= WELCOME To My WebSITE

And that’s why the startcase function is usually more useful because it capitalises the first letter of each word ánd makes all other letters lowercase. How often do you only want to capitalize only the first letter and don’t care about the rest?

lower

Converts all alphabetical characters in a text string to lowercase.

lower(WE LOVE automation SO MUCH)

= we love automation so much

contains

With the contains() function you can check if a specific value is in the text.

contains(I like apples;apples)

= true

The text did indeed contain apples so it returned true.

contains(I like apples;bananas)

= false

This time the text doesn’t contain bananas so it returned false.

This is especially handy if you want to filter something within your function.

Here is slightly more advanced example with the general function if() that gives a different value depending on whether it’s true or not.

if(A=A;The letter A is there;The letter A is not there)

= The letter A is there

So we add our formula to the first part of the if() function and check if it’s equal to true.

if(contains(I like apples;apples)=true;This person loves apples;This person doesn’t love apples)

= This person loves apples

See what happened?

Our text contained apples so it returned true in the contain() function, and because true is equal to true in the if() function it returned This person loves apples.

upper

Wanna convert your whole text to CAPITALS? Then the upper function is your go-to.

upper(Important notice)

= IMPORTANT NOTICE

While you probably don’t need this often, it can be useful for;

  • Standardizing output
  • Specific design or stylistic requirements
  • Case-insensitive Comparisons

startcase

This one is handy to make the first letter of every word a capital, and all the other letters lowercase.

startcase(the GREAT gatsby)

= The Great Gatsby

Some ideas of what you could use this for;

replace

Lets say we have the text Dogs are great. Dogs are fun. and we want to change all instances of Dogs by Cats.

This is were the replace() function comes into play.

Before the divider we have our text, then the thing we want to replace, and then what we want to replace it with.

That looks like this;

replace(Dogs are great. Dogs are fun.;Dogs;Cats)

= Cats are great. Cats are fun.

See how all instances of Dogs got replaced by Cats?

But you can also use regular expressions to search for something in your text.

replace(All these numbers 9283 29382 222 will be replaced with X;/\d+/g;X)

= All these numbers XXXX XXXXX XXX will be replaced with X

Here, /\d+/g is used to match sequences of digits in a string.

  • / indicates the start of the regular expression
  • \d+ matches one or more digits (0-9).
  • /g is a global flag that indicates the pattern should be applied globally to find all matches in the string, not just the first one.

You don’t need to remember those regular expression, you can find an overview of the most common ones here TK.

decodeURL

Decodes special characters in a URL to text.

decodeURL(We%20love%20automation)

= We love automation

encodeURL

Will result in We love automation because %20 is code for a space.

This is the opposite of decodeURL(), instead of decoding special characters we are encoding regular text to special character so it becomes a valid URL address.

encodeURL(We love automation)

= We%20love%20automation

Will result in We%20love%20automation which you can then add behind a URL for example.

https://example.com/encodeURL(We love automation)

= https://example.com/We%20love%20automation

replaceEmoji

This function is handy if you want to get rid of emojis in a text, or want to replace them by something else.

We have this text;
Enjoy your day at the beach! 🌞🏖️

To remove the emoji’s, we want to replace the emojis with nothing, which we can do by mapping emptystring

replaceEmojiCharacters(Enjoy your day at the beach! 🌞🏖️;emptystring)

= Enjoy your day at the beach!

But you can replace it with anything you like.

  • Titles and Headings
  • Street Addresses
  • Product Titles
  • Event Names
  • Course Titles
  • Names and Proper Nouns

trim

The trim function removes space characters at the start or end of a text.

With the previous replaceEmojiCharacters() function you saw for example how we removed emojis, but a space would still be there because there was a space before the emoji.

Enjoying a sunny day at the beach! 

Wrap the item with the trim function like this:

trim(Enjoying a sunny day at the beach! )

And the output will be the sentence without the space at the end;

Enjoying a sunny day at the beach!

I, for example, often use this on data that I get from forms that people fill out themselves.

substring

The substring function is used to extract a portion of text that you specify with numbers.

Here are two examples;

substring(automatewithmax.com;0;8)

= automate

substring(automatewithmax.com;4;7)

= mat

Get it? 🤗

  • First number is the start position (first character).
  • Second number is the end position (last character).

This is especially useful if you have a string of text and only want to simply extract a small part of it.

Assume you have a string representing a timestamp:
2003-09-09T12:45:00

If you only need the year part, you could use substring() to extract the first 4 characters (positions 0 to 4):

substring(2003-09-09T12:45:00;0;4)

= 2003

It’s that easy!

indexOf

The indexOf() function in Make.com finds where a specific value appears first in a string. If the value isn’t found, it returns -1.

The value can be a letter, as shown in the examples below, but it can also be a symbol, emoji, or other character.

indexOf(Automation;m)

= 4

It returned 4 because “m” is the fourth letter in “Automation” because the first letter is 0.

Another example;

indexOf(Automation;t)

= 2

It returned 2 because “t” is the second letter in “Automation” because the first letter is 0. The word “Automation” actually has two times the letter “t” in it, but it will only tell you when the letter first appeared.

But what if the value wasn’t found?

indexOf(Automation;z)

= -1

As you can see, if the function can’t find the letter it will return -1.

And you have to keep in mind that this search in case sensitive, if you want to know the position of a letter regardless of the capitalization, consider combining the formula with the lower() function:

indexOf(lower(Automation);a)

= 0

It now returned 0 instead of 5 because it made “Automation” lowercase so it could match the first letter of the word.

escapeHTML

The escapeHTML() function converts special HTML characters in a text into their equivalent HTML entities.

This is useful for displaying HTML code as text on web pages without it being interpreted as actual HTML.

escapeHTML(<p>Text</p>)

= &lt;p&gt;Text&lt;/p&gt;

Here’s the breakdown:

  • < becomes &lt;
  • > becomes &gt;

So <p>Text</p> is escaped to &lt;p&gt;Text&lt;/p&gt;, ensuring the HTML tags are displayed as text rather than being rendered as HTML elements.

stripHTML

This function is useful to get rid of all HTML, and convert it to a regular text.

stripHTML(<p>Text</p>)

= Text

escapeMarkdown

I find this especially useful to get the text from a HTML email, or to scrape only the text of a webpage.

Markdown is a lightweight way to format text in plaintext documents so it can be easily converted into HTML.

For example:

  • **bold text** makes text bold
  • *italic text* makes text italic
  • # creates a big header

As you can see, markdown uses special characters to apply these styles.

So, if you have some Markdown-formatted text and you want to show the special characters themselves (without them being formatted), you use escapeMarkdown().

escapeMarkdown(# Header)

= &#35; Header

split

The split() function breaks up a piece of text into smaller parts wherever a specific separator (like a comma) appears

Imagine you have a list of names separated by commas, and you want to split them into individual names. The function does that for you.

split(Max, Emmah, Joe;,)

= Max
Emmah
Joe

md5

The md5() function generates a fixed-length string, known as a hash, from any given text. This hash is always 32 characters long and looks like a random mix of letters and numbers.

md5(Max)

= 6a061313d22e51e0f25b7cd4dc065233

Some important things to know:

  • The input can be any text, and the output is always a 32-character hash.
  • The same input will always give the same hash.
  • So, md5(Max) will always return 529a05ca6c1263aab080ec4f20754411.
  • They’re not secure enough for modern password storage.

People use them to compare data to see if they’re the same, without having to compare a large amount of data.

sha1

The sha1() function generates a SHA-1 hash from a text string. Like MD5, this creates a unique fixed-length code (a hash) that represents the original text.

sha1(Max)

= a95e85aed56318093b024674e217cae0bd30241d

sha1(Max;base64)

= qV6FrtVjGAk7AkZ04hfK4L0wJB0=

sha1(Max;base64;key)

= AplJ9xqeIH0l8av1gfLWuJJVxI4=

Handy to know;

  • The output hash is a fixed-length string of letters and numbers.
  • You can choose hex (default) base64 or latin for encoding.
  • If you provide a “key” as an extra argument, it creates an HMAC hash, which adds extra security. HMAC is used in secure communications where the key acts like a shared password between two systems.

Hashes like SHA-1 are used for integrity checks and digital signatures but are more secure than MD5 for most purposes. However, even SHA-1 is no longer considered fully secure for critical applications.

sha256

The sha256 function generates a SHA-256 hash from a text string. This hash is longer and considered more secure than MD5 or SHA-1.

sha256(Max)

= a1a5936d3b0f8a69fd62c91ed9990d3bd414c5e78c603e2837c65c9f46a93eb8

sha256(Max;hex;crazypassword)

= 321b5eb57b52633e78cf380b3293a85f3b0907045b078f94988868d40233ef0c

What you need to know;

  • The output is a 64-character long string (in hexadecimal) that uniquely represents the input text.
  • You can choose hex (default) base64 or latin for encoding.
  • If you provide a “key,” the function creates an HMAC SHA-256 hash, which uses the key for added security. This is used in scenarios where you need to ensure that the hash was generated by someone who knows the key.

SHA-256 provides a higher level of security and is commonly used in cryptographic applications, digital signatures, and for verifying data integrity.

sha512

The sha512() function calculates a SHA-512 hash from a string.

SHA-512 is a cryptographic hash function that generates a 128-character long hash, offering a higher level of security compared to SHA-256.

sha512(my darkest secrets)

= 7615bcb50b7bc356ac6223af53f4bb3aeb0051ec5945ccf3c02b1ffae102c0d07b155cc785d304299b36db4c3b78f4b89ecc980cbb38109995d1ebee13aa983a

sha512(top secret;hex;mybestpassword)

= a7d2c44c21db60aaa6638dc925311cd62d718bbfd8a292a5df50466ca347bb0c8e6f012f58d914ce47544bdd07988935386c8978bf32cf0c0cade31e827884da

Need to know;

  • The output is a 128-character long string when encoded in hexadecimal.
  • You can choose hex (default) base64 or latin for encoding.
  • Supported encodings for keys are text (default), hex, base64 or binary.

When a key is used, SHA-512 HMAC is computed, which is more secure for verifying data authenticity by ensuring only someone with the correct key can generate or verify the hash.

base64

The base64() function is a way to turn text into a format that’s safe to use in many systems, especially where only text is allowed or to make sure data stays intact during transmission.

base64(Max)

= TWF4

If you have Base64 encoded text and want to get the original text back, you can decode it with the toString() function.

toString(toBinary(TWF4;base64))

= Max

Base64 encoding is useful when you need to include data in places that only accept text, like email or URLs.

toBinary

The toBinary() function changes a value into binary data, which is a form of data used by computers. Binary data is made up from numbers 0 to 9 and letters A to F.

toBinary(Max)

= 4d 61 78

You can also add a second argument to let Make know what kind of data you want to convert to binary, in this case it’s base64.

toBinary(TWF4;base64)

= 4d 61 78

This is handy if you want to store data very compactly, but usually only used by programmers and developers.

toString

Only handy for converting values to strings, in Make you would usually use it to convert base64.

toString(toBinary(TWF4;base64))

= Max

ascii

The ascii() function is used to remove characters from a text string that aren’t part of the standard ASCII character set, which includes letters (A-Z, a-z), numbers (0-9), and some special symbols.

Non-ASCII characters are often used in languages like French (é, à), umlauts in German (ü, ö), and characters in languages like Chinese, Japanese, and Korean

So the standard function simply removes the non-ASCII characters;

ascii(¡Hola, señor! ¿Cómo está?)

= Hola, seor! Cmo est?

And if you add true it will convert the characters to a regular letter.

ascii(¡Hola, señor! ¿Cómo está?;true)

= Hola, senor! Como esta?

Combining text functions

Ok, now it’s going to get juicy.

To level you up from beginners to pro, we’re going to combine string functions.

Normalize an email address

People enter their email address in all kinds of weird formats, use this formula to normalize the text.

trim(lower(ascii( eMmah.DOé@EXAMple.cöm;true)))

= emmah.doe@example.com

What this does;

  • trim() removes any spaces at beginning or end.
  • lower() makes the email address lowercase
  • ascii() converts non-ASCII characters

But we can go further.

Some people add something like +automatewithmax to their email address which creates multiple variations of their email address but all end up in the same inbox;

  • emmah.doe+automatewithmax@example.com
  • emmah.doe+newsletter@example.com
  • emmah.doe+invoices@example.com
  • emmah.doe+work@example.com

Usually this is no problem for online business owners because the email you sent still arrives, but occasionally you might want to check for duplicates on your email list.

To do that, we need to remove the + and whatever is in between the + and @.

We can use the replace() function with the \+.*?@ regular expression, and replace whatever we found with @.

replace(emmah.doe+work@example.com;/\+.*?@/;@)

= emmah.doe@example.com

To use this, keep in mind that you have to enclose the regular expression in /…/ like I did in the example above.

And I’ve noticed that people often make a typo by typing .con instead of .com, so we can fix that too;

replace(emmah.doe@example.con;.con;.com)

= emmah.doe@example.com

As you can see, you can go really far with this.

And you can combine all of the above in one monster formula;

trim(ascii(replace(replace(lower(emmah.DOE+work@exämple.con);/+(.*?)@/;@).con;.com);true))

= emmah.doe@example.com

That’s it!

Get my best tips for Make.com 🧙‍♂️

Practical & fun automation tips that are easy to implement in your online business



* No spam, ever.

Become a Make.com expert

Learn how to quickly save hours a week in your online business

Tell me more about the course! 🔥