Converting Data Types

Learn how to convert data to another type in a Notion formula.

Notion formulas can only return data of a single type. For reference, Notion formulas work with seven distinct data types:

Additionally, you can only compare data that share the same type when you use comparison operators such as equal, and, or larger (and some require a specific data type).

Therefore, you’ll often need to convert data from one type to another in order to get your formula to work.

Here are all the methods you can use to convert data to another type.

To numbers:

Function/MethodExample
toNumbertoNumber("42")

To Booleans:

Function/MethodExample
ifif(prop("Text") == "true", true, false)

Good to know: You can’t truly convert strings, numbers, or dates to Boolean values. What you can do is write a simple statement that outputs a Boolean true/false value using your starting piece of data as criteria.

To strings:

Function/MethodExample
formatformat(42)

To Booleans:

Function/MethodExample
ifif(prop("Num") == 42, true, false)

To dates:

Function/MethodExample
fromTimestampfromTimestamp(prop("Num"))

Note: fromTimestamp only works if its argument is a valid Unix timestamp.

Good to know: replace, replaceAll, and test are able to automatically convert numbers and Booleans (but not dates) to strings. Manual type conversion is not needed.

To strings:

Function/MethodExample
formatformat(true)

To numbers:

Function/MethodExample
toNumbertoNumber(true)
unaryPlus (+)+true

To strings:

Function/MethodExample
formatformat(now())
formatDateformatDate(now(), "MMM DD YYYY")

To numbers:

Function/MethodExample
timestamptimestamp(now())
toNumbertoNumber(now())
minuteminute(now())
hourhour(now())
dayday(now())
datedate(now())
monthmonth(now())
yearyear(now())

Good to know: the toNumber function converts dates to their Unix timestamp, just like the timestamp function.

To Booleans:

Function/MethodExample
ifif(prop("Date") == now(), true, false)
About the Author

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.

🤔 Have an UB Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas

🤔 Have a Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas