Text Functions in Notion formulas! (Part Two)
Formulas in databases hold the key to the hidden potential of Notion! From complex mathematical calculations to automating certain actions, you can do so much if you know how to build custom formulas! In this article, I will explain some text functions in Notion formulas along with some simple examples.
In the previous article of the Fantastic Formulas, we learned how to use the first 4 Text-functions in Notion formulas. Make sure to check out the previous articles in this series for a compete guide to Notion formulas!
There are 5 remaining Text functions:
Let us create a simple database to track/manage daily Tweets in Notion. As you can see below:
The 'Name' property shows the serial number of the tweet and the 'Tweet Content' property shows the content of the Tweet.
length function returns the number of characters in a text string. The function takes a single argument, which is the text string to measure. The function returns an integer representing the number of characters in the string.
As you can see below, this formula shows the total number of characters used in the tweet! 🔽
replace function allows you to replace a specified substring within a text string with another string. The function takes three arguments: the text string to modify, the substring to replace, and the string to replace it with. The function returns a new text string with the specified substring replaced.
As you can see below, this formula replaces ":fire:" with the fire-emoji! 🔽
replaceAll function allows you to replace all occurrences of a specified substring within a text string with another string. The function takes three arguments: the text string to modify, the substring to replace, and the string to replace it with. The function returns a new text string with all occurrences of the specified substring replaced.
As you can see below, this formula uses the replaceAll function to replace all the keywords with their respective emojis! 🔽
slice function allows you to extract a portion of a text string. The function takes three arguments: the text string to extract from, the start index, and the end index. The start index and end index specify the portion of the string to extract, and are zero-based. The function returns the specified portion of the string.
As you can see below, this formula displays the content of 'Name' property but only the content after the 6th character! 🔽
test function allows you to match a text string against a regular expression. The function takes two arguments: the text string to match and the regular expression to match against. The function returns a Boolean value indicating whether the text string matches the regular expression.
As you can see below, this formula uses the test() function to check wether the 'Tweet Content' property contains the specified keyword or not! 🔽
So now you know how to use Text functions in Notion formulas! You can use these functions to build custom formulas in your personal Notion space. Using formulas can help you get the most out of Notion. You can also use our shortcut commands template to be more efficient using these.
Make sure to check out the Fantastic Formulas series for a complete guide on Notion formulas! Follow us on Twitter for daily motivation, new template launches and super-saver deals on Top-rated Premium Notion templates! And if you know some tips/tricks that you want to share with other Notion users, you can write for us! Reach us via email@example.com