Selects Not Working in Notion Formulas? Try this.

Notion recently shipped a handy user-interface update to the Formulas editor which, when toggled on, shows brackets ([ and ]) around list types and also informs you of what type of data-type is being returned by formulas.

This was a great feature update; one that made it easier to understand why things might be going haywire in our Notion Formulas.

I’ve noticed though that folks are still getting confused by the difference between Strings and Lists in Formulas even with this new feature. One example of this is the confusion between Select/Status properties and Multi-Select properties.

This is because Select properties are returned as Strings in Notion Formulas, whereas Multi-Select properties are returned as Lists containing Strings. 

So what does this mean in practice? Well, if I have a Select or a Status property and one of it’s options is “Updated”, when I reference it in a Formula I can use the equality operator to see if it matches an expected string:

				
					prop("Select") == "Updated" /* => true */
				
			

This is because the return of a Select object is a String. So when I call prop("Select"), what gets returned is the value of the Select as a String:

				
					"Updated"
				
			

So using the == or equality operator and comparing it against the same string will return true.

However, if the property were a Multi-Select property, when I only have a single item selected, this would actually return false:

				
					prop("Multi Select") == "Updated" /* => false */
				
			

This is because the return result in this case is a List which would actually look something like this:

				
					["Updated"]
				
			

So our formula would end up looking like this, which, since == also compares the object types, would be “falsey” (i.e. return false) given that a List does not match a String.

				
					["Updated"] == "Updated" /* => false */
				
			

Because Multi-Select properties are returned as Lists, we need to use a different method to check if it matches. In this case, we want to use includes to test if the List includes the String.

				
					prop("Multi Select").includes("Updated") /* => true */
				
			

Note that we can also use contains to do this test, but Notion will not auto-complete contains if you are working with a list object.

How else can we do this?

One other way we could accomplish this task is to first convert the List to a String by using the format function.

In Notion Formulas and programming in general we typically call this type coercion, as-in we are coercing a value of one type to another type.

				
					prop("Multi Select").format() == "Updated" /* true */
				
			

This turns the List ["Updated"] into the String "Updated" thus ensuring that the values match. This could be a good way to ensure that the multi-select only has “Updated” in the List as well since a List such as ["Updated", "In progress"] would return true if you used the includes function, but false if you used the coercion method since the following would be falsey:

				
					"Updated,In progress" == "Updated" /* false */
				
			

Want to learn more about Notion Formulas 2.0?

Hopefully this mini-dive into property types was helpful. If you want to go deeper, pick up our Formula Fundamentals 2.0 course as we go into deep dives on every topic in Notion Formulas.

Get Formulas and other Notion tips in your inbox 

Fill out the form below this blog to sign up for our newsletter!

Share This Post

LinkedIn
Twitter
Email

Get 🔥 Notion tips in your inbox

When you sign up, you’ll get tips, perspectives, and opinions on how you can better use Notion. Plus you’ll get a steady drip of Notion updates, videos, interviews, and resources from the Notion Mastery team.

Master your life and business workflows with Notion.