How to count characters of a property on Notion easily using formulas
In this pro tip Iâm going to show you one of the features Iâve learned and have been using for a while: the use of formulas in the properties of a Notion document.
What are Notion Formulas?
In addition to the many more traditional types of Notion properties such as an option selector or a list of categories (tags), it is also possible to extend properties features using formulas.
Notionâs formulas allow you to make calculations or perform functions based on other properties from that document.
The coolest part of these formulas is that once implemented, the result will be automatically updated if you make any changes to the property used in the formula.
Why use formulas on Notion?
I recently started using Notion as a task organization system for GitFichas (git study cards) using Databases.
As each card is followed up by a tweet, I also like to draft the tweets in the same interface to be able to pre-schedule the release of new cards. One of the problems of using Notion for this is that it lacks the character count that exists on Twitter interface, thatâs where Notionâs formulas came into my life.
How to create a formula-based property
I have a property called âTweetâ in the database that I use to keep track of GitFichas. It is in this property that I draft the tweet for each new card.
Notice in the image above that the character count is missing so letâs add it. First click on âAdd a propertyâ to add a new property and choose the type ââ Formulaâ from the menu. Then you will see the property edit menu, like this:
You can give the property a name, something like âTweet Sizeâ by editing the field with the default value âFormulaâ. Then click on âEditâ to see the way of writing the formula itself.
In this menu you can either compose your formula by writing or selecting between functions, constants, operators and properties. To count characters you can write:
length(prop("Tweet"))
Click Save and exit the menu then you will see your new property with the corresponding character count.
Iâll leave it to you to play with changing the text and seeing the resulting value of the formula update automatically. đ
Recap
Formulas on Notion are a powerful extensibility feature. You can use formulas in Database documents. Hereâs a step-by-step guide on how to create a formula in a document:
- Click on âAdd propertyâ;
- Choose the option ââ Formulaâ;
- Name your formula in the âFormulaâ field;
- Click on âEditâ to write the formula;
- Write
length(prop("Tweet"))
in the field âType a formulaâ (remember to adjust the field name); - Click on âSaveâ.
And thatâs it, now itâs time to have fun editing the corresponding field and see the value change automatically.