🔎 Find The Length
The length function in Notion can be very useful for querying and calculating data. For instance, one can find titles over 30 characters or find the average number of items in a multi-list. Below is how the function works alone, and also some use-cases for it.
What The Length Function Does
It finds the amount of characters in the property it points to.
Included are empty spaces. For example, “The Matrix” is not 9 characters in length; the space makes it 10.
Length Syntax
length(prop(“NAME OF PROPERTY”))
Use-Cases The Length Function
Create a unique ID number for data entries
slice(format(multiply(timestamp(prop("Created Time")), length(prop("Name")))), 0, 10)
Find number of items in a text property list, multi-select list or relation list
if(length(prop("Tags")) > 0, length(replaceAll(prop("Tags"), "[^,]", "")) + 1, 0)
Find Average Star Rating In A Row
slice("⭐️⭐️⭐️⭐️⭐️", 0, (length(prop("Monday")) + length(prop("Tuesday")) + length(prop("Wednesday")) + length(prop("Thursday")) + length(prop("Friday")) / 2) / 5)