length
Learn how to use the length function in Notion formulas.
1
length(string)
1
length("Monkey D. Luffy") // Output: 15
2
3
length("Supercalifragilisticexpialidocious") // Output: 34
4
5
length("Doctor Doom") // Output: 11
This example database used the
length()
function to return the number of characters in the Name property. It also uses an if statement to intelligently output “character” or “characters”.
1
// Compressed
2
format(length(prop("Name"))) + " " + ((length(prop("Name")) == 1) ? "character" : "characters")
3
4
// Expanded
5
format(
6
length(prop("Name"))
7
) +
8
" " +
9
(
10
(
11
length(
12
prop("Name")
13
) == 1
14
) ?
15
"character" :
16
"characters"
17
)
Second, an if statement again uses
length()
to check whether or not the number of characters in the Name property is equal to 1
. If so, it outputs the singular “character”. If not, it outputs the plural “characters.”
My name is Thomas Frank, and I'm a Notion-certified writer, YouTuber, and template creator. I've been using Notion since 2018 to organize my personal life and to run my business and YouTube channel. In addition to this formula reference, I've created a free Notion course for beginners and several productivity-focused Notion templates. If you'd like to connect, follow me on Twitter.

Last modified 4mo ago