Meet Notion's Formula Property: Part 1
Summary
TLDRThe video script introduces the Formula property in Notion as a powerful feature that automates calculations and reformatting of data within databases. Users can create new properties with the formula type to generate unique values for each item by writing formulas that perform operations on other properties' values. The script covers the basics of formula composition, including the use of operators for arithmetic and concatenation, and the use of functions that package these operations. It also explains how to reference other properties within a formula to create dynamic and context-specific values. The importance of value types is emphasized, with examples of how operators behave differently with numbers and strings. The script concludes with a teaser for further resources and videos that delve deeper into formula conditions and advanced examples, encouraging users to explore the full potential of Notion's formula capabilities.
Takeaways
- π’ The Formula property in Notion is a powerful feature that can automatically generate values for each item in a database by executing a predefined formula.
- π Users can reference three resources on Notion VIP for learning about formulas: a video introduction, a collection of examples, and a cheat sheet with all functions, operators, and constants.
- β Formulas can perform calculations using other property values or reformat values, such as calculating a player's age from their birthday or adding context to a number.
- π‘ To write a formula, you create a new property, select the 'Formula' type, and compose your formula using either operators or functions.
- π§ Operators are symbols that perform actions on values, like addition (+), subtraction (-), multiplication (*), division (/), and modulo (%).
- π Functions are like packaged operations that require specific arguments and can perform more complex tasks than operators.
- π Literal values are directly input into the formula and used for every iteration, while constants are predefined values like mathematical constants or booleans.
- π To reference another property's value, use the `prop` function, specifying the property name as an argument.
- π Value types are crucial in formulas; they include numbers, text strings, dates, and booleans, and must match the expected input types of operators and functions.
- 𧩠Concatenation can be achieved using the `+` operator with text strings, the `concat` function, or the `join` function with a specified separator.
- π Notion automatically aligns numbers to the right and strings to the left, which can help identify the value type in a formula.
- π Conversion between value types is possible using functions like `format` to convert numbers to strings and `to_number` to convert strings to numbers.
Q & A
What is the Formula property in Notion?
-The Formula property in Notion is a feature that allows users to automatically generate values for each item in a database by conducting a series of operations defined by the user through a formula. It can reference other properties for each item, and because those properties vary from item to item, the output of the formulas will also vary.
How can the Formula property be used to calculate new values in Notion?
-The Formula property can be used to calculate new values by combining or manipulating the values of other properties. For example, it can concatenate a first name and last name to create a full name, or it can calculate a person's age by finding the difference between their birthday and the current date.
What are the three resources available on Notion VIP for learning about formulas?
-The three resources available on Notion VIP are: 1) A guide called 'Meet Notion's Formula Property' corresponding with a video, 2) A collection of simple and useful formula examples with a corresponding video, and 3) A cheat sheet that includes every Notion function, operator, and constant with descriptions and examples, as well as patterns for formatting dates within Notion.
How do you create a new Formula property in Notion?
-To create a new Formula property, you add a new property as you would with any other type, but for the type, you choose 'Formula'. You can then compose your formula by clicking the top of the property and choosing 'Edit formula' or by clicking any cell beneath it to open the formula composition window.
What are the two ways to define actions in a Notion formula?
-In a Notion formula, actions can be defined using either operators or functions. Operators are characters placed between two values to perform an action, such as '+' for addition or '*' for multiplication. Functions are more complex and consist of a keyword followed by a set of parentheses, where you put your inputs (known as arguments).
How does the Formula property use literal values?
-Literal values in the Formula property are values that are input directly into the formula and do not reference another property. They will be the same for every iteration of the formula. An example is using the number '2' or a text string 'age' in a formula to ensure it appears the same across all database items.
What is the purpose of the 'prop' function in Notion formulas?
-The 'prop' function in Notion formulas is used to reference another property within the formula. It takes the name of the property to be referenced as an argument and allows the formula to use the value of that property for each specific item in the database.
How can you reformat values in Notion using formulas?
-Reformatting values in Notion using formulas can be achieved through the use of functions that format dates or through concatenation to combine text strings with other values. For example, you can append the text 'age: ' before a numerical value representing age to provide context.
What are the four primary types of input values that Notion accepts in formulas?
-The four primary types of input values that Notion accepts in formulas are numbers, text strings, dates, and boolean values (true or false).
Why is it important to pay attention to value types when using Notion formulas?
-It is important to pay attention to value types in Notion formulas because every operator and function accepts certain types of inputs. Using incorrect or inconsistent value types can result in errors. Ensuring the correct value types are used guarantees that the formula operates as intended and produces accurate results.
How can you convert a number to a string or a string to a number in Notion formulas?
-Notion provides the 'format' function to convert a number to a string and the 'to_number' function to convert a string to a number. The 'format' function is particularly useful for concatenating a numerical value with a text string.
What is the 'now' function used for in Notion formulas?
-The 'now' function in Notion formulas is used to generate the current date. It accepts no arguments and is always up-to-date with the current date, making it useful for calculating time intervals such as a person's age.
Outlines
π Introduction to Notion's Formula Property
The video introduces the Formula property in Notion as a powerful yet underutilized feature. It emphasizes the potential of formulas to enhance Notion workspaces and mentions three resources for further learning: a video tutorial, a collection of formula examples, and a cheat sheet covering all Notion functions, operators, constants, and date formatting patterns. The Formula property is explained as a unique feature that automatically generates values for each item in a database by executing a user-defined formula, often referencing other properties to produce varying outputs. An example is given on how to create and use a simple formula to add two numbers.
π’ Formulas for Calculations and Reformatting
This paragraph delves into the two main uses of formulas: calculating new values from existing property values and reformatting values. Examples include creating a full name from first and last names, calculating a person's age, and determining the tax and total price of items in an online store order database. The paragraph also highlights the use of formulas in enhancing the presentation of information, such as adding context to a player's age in a gallery view. The basics of formula composition are introduced, including answering high-level questions about actions, inputs, and conditions, with a focus on actions and inputs in this segment.
𧩠Understanding Operators and Functions
The paragraph explains the difference between operators and functions in the context of Notion formulas. Operators are basic symbols that perform actions between two values, such as addition (+), subtraction (-), multiplication (*), division (/), and modulus (%). Functions are more complex, described as packaged operations that require specific arguments. The paragraph also touches on how operators can act differently based on the types of values they are used with, such as the plus sign concatenating text strings instead of adding numbers. The concept of literal values and constants as inputs for formulas is introduced, with examples provided.
π Referencing Properties and Concatenation Techniques
This section focuses on how to reference other properties within a formula using the prop function and how to concatenate values to create new information, such as combining a first name and last name to form a full name. It also discusses alternative methods for concatenation, such as using the concat and join functions. The importance of understanding how formulas use the values from referenced properties to generate different outputs for each item in the database is emphasized.
π‘ Value Types and Their Significance in Formulas
The importance of value types in Notion formulas is discussed, with a focus on how operators and functions accept specific types of inputs. The four primary input types in Notion are numbers, text strings, dates, and boolean values. The paragraph explains how the plus sign can act as both an arithmetic operator and a concatenation operator depending on the context. It also covers how to use the now function to generate the current date and how to calculate the difference between two dates. The rendering of true and false values as checkboxes in Notion is highlighted, along with the use of constants like pi in calculations.
π« Handling Type Mismatch Errors and Conversion Functions
The final paragraph addresses the potential for type mismatch errors when using incorrect value types in formulas and the importance of aligning value types correctly. It provides a trick to identify value types by their alignment in the interface: numbers align to the right and strings to the left. The paragraph introduces two functions for converting value types: format, which converts numbers to text strings, and to number, which converts strings to numbers. An example is given on how to concatenate a text string with a number after converting the number to a string. The paragraph concludes with a reminder of the resources available for learning more about Notion's Formula property.
Mindmap
Keywords
π‘Formula Property
π‘Literal Values
π‘Property Reference
π‘Concatenation Operator
π‘Functions
π‘Operators
π‘Value Types
π‘Constants
π‘Conditions
π‘Cheat Sheet
π‘Gallery View
Highlights
The formula property in Notion is a powerful feature that can automatically generate values by conducting a series of operations defined by the user.
Formulas can reference other properties, allowing for dynamic and item-specific outputs within a database.
Three resources for learning about Notion formulas include a video introduction, a collection of examples, and a comprehensive cheat sheet.
Formulas can be used to calculate new values from existing properties, such as creating a full name from first and last names or calculating a player's age.
Reformatting values is another use of formulas, such as appending context to a number or using patterns to format dates.
Formulas answer high-level questions about actions, inputs, and conditions, with alternative actions defined for unmet conditions.
Operators in formulas perform actions on values and can function differently based on the type of values used, such as addition for numbers or concatenation for strings.
Functions in Notion are packaged operations that can take multiple arguments and are categorized by logic, numeric, text, and date/time.
Every function in Notion has a corresponding operator, such as the 'add' function corresponding to the '+' operator for addition.
Literal values and constants are directly input into formulas and do not change with each iteration, making them useful for consistent elements like labels.
The 'prop' function is used to reference other properties within a formula, allowing the formula to dynamically adapt to each database item.
Value types in Notion are crucial for formula composition, with different operators and functions requiring specific types such as numbers, text strings, dates, or booleans.
Mismatching value types in a formula will result in an error, emphasizing the importance of understanding and using the correct value types.
The 'format' function can convert numbers to text strings, and 'to number' can convert strings to numbers, aiding in formula composition when different types are required.
Notion's gallery view can be enhanced with formulas to provide context, such as labeling a calculated age with the term 'Age' for clarity.
A cheat sheet available on Notion VIP includes every function, operator, and constant with descriptions and examples, aiding users in mastering formulas.
Understanding and correctly using value types is essential for successful formula composition and avoiding errors in Notion.
Transcripts
the formula property is one of notions
most powerful yet underutilized features
with this brief introduction and a
little bit of practice users at all
levels can use formulas to bolster their
notion workspaces and as you get to know
and work with formulas you might want to
reference three resources available on
notion VIP so the first is opposed
called meet notions formula property
that's going to correspond with this
video the second is a collection of
simple and useful formula examples that
will also have a corresponding video and
then the third will probably prove most
beneficial to you in the long run and
that's a cheat sheet that includes every
notion function operator and constant
with a description and an example and it
also includes the patterns that you'll
use to format your dates within notion
formulas so what is this formula
property well like the other properties
you're used to working with like texts
and number and date the formula property
is going to contain a unique value for
each item in your database but unlike
those other properties where you
manually input the value for each item
in the database the formula property is
going to generate its values
automatically and it does that by
conducting a series of operations that
you define and you define those
operations by writing a formula and that
formula is going to execute on each item
in your database and oftentimes it's
going to reference other properties for
each of those items and so because those
properties are gonna vary from item to
item the output of your formulas will
vary as well so let's take a look at an
example to write a formula you'll create
a new property just like any other
property and for the type you'll choose
formula
to compose your formula and you can
either click the top of the property and
choose edit formula or you can click any
cell beneath it and that's going to open
up this formula composition window so a
formula can be as simple as two plus two
or it can really be as simple as just
the number two or the value of true but
we'll type two plus two as our first
formula here and then after typing your
formula you can click the done button or
you can hold command or ctrl on your
keyboard depending on what type of
computer you're using and then hit
return or enter so here we have four
returned for every item in our database
and the reason is we entered what's
called literal values we used a 2 and a
2 for our values so that's going to be
the value that your formula uses in
every iteration for every item in the
database but as I mentioned you're
typically going to reference values from
other properties in the database so when
the formula executes on each item it
will use that items respective values
for those properties in order to
generate a unique output so that'll make
the output different for most items
so our first formula returned a bunch of
fours which are useless to us so what is
useful about the formula property well
you're going to use formulas for kind of
two overarching reasons the first is to
calculate new values from the values of
other properties so let's look at a
couple of quick examples of that in our
database of players that comprise a
basketball team we're given the last
name in the first name and then using a
formula we can combine the last name in
the first name to create the full name
in another example were given the
player's birthday and by finding the
amount of time between the birthday and
the current date and time were able to
calculate the players age
and then moving down to our database of
orders from an online store we can see
that we are given the tax rate and then
each item has an independent price and
so by multiplying the price and the tax
rate we know exactly how much tax to add
to the price of each item and then we
can calculate the total price of each
item by adding the tax and the original
price
so the second overarching use of
formulas is going to be to reformat
values so we mentioned that we'll be
using patterns to format dates but one
of my favorite uses of this reformatting
approach is using notions gallery view
so if we look at our player roster in
the gallery view we can see that we have
the player's headshot as the card cover
and then we're using that calculated
full name within the players information
and then we also have this arbitrary
number we're not quite sure what it
means we're inclined to think that it
probably corresponds with the players
jersey number but in reality that's the
players age so using a formula we can
append some helpful context to that age
we can add the term age with a colon
that will allow us to understand exactly
what that number means so we already
have this pre configured here let's swap
out the standalone age and include the
labelled age and there we have a very
nicely contextualized age for each
player on our roster so we have a
glimpse into what the formula property
is and why it's useful
let's explore exactly how it works so
when you compose a formula you're gonna
answer one or more of three kind of
high-level questions you're gonna answer
do what what are the actions that you
want the formula to take to what what
are the input values on which you want
those actions to be taken and
when what conditions need to be met in
order for those actions to be taken and
then you can also define alternative
actions to be taken when those
conditions are unmet so we're going to
cover the first two here in this video
and then a later video we'll cover the
conditions question so let's start with
the actions when you compose your
formula you can define your actions in
one of two ways you can use operators or
you can use functions so let's start
with operators operators are very simple
you're already familiar with them so I
don't want to over complicate them here
an operator is simply the plus sign that
we use to add two in to an operator is a
character that you place between two
values to perform an action on those
values so the plus sign performs
addition the minus sign performs
subtraction we have the star character
to perform multiplication the backslash
to perform division and then we can use
the percent sign to return the remainder
after division so if you go over to that
cheat sheet at notion dot VIP
slash formulas at the top you'll find
kind of a sub navigation menu and within
that menu you'll find operators so if
you click on the operators that's going
to jump down the page to a list of those
operators that I just described so the
way that I described those operators
where they're placed between two numbers
to perform an action on those numbers
that makes them arithmetic operators and
that's the largest number of operators
but I mentioned that when you place that
plus sign between two numbers such as
the two and two it performs addition on
them making it an arithmetic operator
but if you place that plus sign between
two strings of text it's going to
combine those two strings or it's going
to concatenate them and that makes the
plus sign in that instance a
concatenation operator rather than an
arithmetic operator
so let's take a quick look at the use of
an operator of course we've already
added 2 & 2
when we did so we were using the
addition operator and arithmetic
operator but if we were to place those
two twos within quotation marks that
makes them strings they're not
technically numbers and we're gonna
explore value types here in just a
little bit but when we confirm this
formula we're gonna see 2 & 2 here
returned by our formula and they're
aligned to the left rather than to the
right meaning that they are a text
string rather than a number that can be
used as a input with arithmetic
operators so that's operators let's dive
into functions so if functions are kind
of like packaged series of operations
and they consist of a keyword followed
by a set of parentheses and within those
parentheses you put your inputs in the
case of functions those inputs are known
as arguments in every function can
accept one two three or virtually
unlimited arguments so going back over
to our cheat sheet scroll back up to the
top and then look again at our sub
navigation menu you can see here that we
have a functions category and within
that category you can see that we have
four different types of functions so we
have logic functions numeric functions
text functions and date and time
functions and generally those types of
functions are going to correlate with
the types of inputs or arguments that
those functions accept or the types of
values that they return so if we jump
down the page we can see a full list of
notions functions and you can see that
they consist of that keyword followed by
a set of parentheses
so each of these functions within this
cheat sheet are gonna include a brief
description an example and then a list
of that functions arguments you can see
how many arguments the function takes
and you can see exactly what those
arguments need to be so let's look at a
function so actually there's a function
that corresponds with each operator that
we just discussed so we added the
numbers two and two using the addition
operator but there's actually a function
called add add is the keyword and then
within the parentheses for its arguments
we could just put two and two again and
you're gonna separate a functions
arguments with a comma so when we
confirm this formula we're gonna see
that we have our useless series of fours
here again but it came about those fours
in a different way rather than using the
addition operator it used the add
function and as you saw there are a
variety of different functions that
perform a variety of different types of
operations on their inputs and we're
gonna be looking at a few examples
throughout the rest of this video but
another video covers a collection of
simple and useful examples and as I
mentioned there's also that
corresponding post on notion VIP and
that's linked within the youtube video
description so those are our actions
operators and functions are the way that
we tell a formula what we want it to do
so let's move on to input values what
are the values on which we want those
actions to be taken and there's three
different types of input values that you
can provide a formula we've already seen
literal values so let's explore them
briefly here first so as I mentioned
when
- and - whether using the operator or
the function those twos are literal twos
we input them directly into the formula
and because they don't reference another
property those two and twos are going to
be the inputs for every iteration of the
formula so as I've said that's kind of
useless here in this example but we did
see a useful example of literal values
and that's when we created our labelled
age property when we added the text
string age to the age the actual age
which is a reference to the age property
that texturing was a literal value it's
the same for every iteration of this
formula and we want it to be that way
because we want that term age to appear
within our player gallery for every
player so that's a useful example of
literal values so we also have the
option to use constants as our inputs
and constants you're not going to use
very frequently so I won't spend a lot
of time on it but notion offers a
collection of mathematical constants
such as pi you may be familiar with to
perform more advanced calculations so
those constants if you're interested are
also available on the cheat sheet back
up at our sub menu we can see that we
have a constants options here at the
bottom and here's a list of constants so
technically true and false are constants
as well and true and false are
interesting in notion because when a
formula returns the value of true or
false it's going to display that output
as a checkbox so false is just going to
show an empty checkbox and then true is
going to show a check checkbox and of
course when you just use that value for
every iteration
of the formula it doesn't it doesn't
offer much purpose but you can imagine
that if we're using conditions and we
want to say if this this and this are
true check the box otherwise leave it
unchecked then this rendering of true
and false can be helpful so those are
literal values in constants but most
often your formulas are gonna reference
other properties for its input values so
each time your formula performs its
operations on an item in your database
it's gonna reference the properties for
that specific item and because the
values of those properties will differ
from item to item the way that your
formulas use it within its operations is
going to differ as well and that will
create a different output for each item
in your database so let's see exactly
how that works to verb to reference
another property there's a special
function the function uses the prop
keyword and then you'll open its
parentheses and for its argument you're
gonna input the name of the property
that you want to reference within
quotation marks so we created the full
name by combining the first name and the
last name along with the space between
them so we referenced the first name in
the last name to do that so let's look
exactly how we may have done that with
the prop function we can include first
name and then we can use that plus sign
and remember when placed between strings
of text that's going to combine them or
concatenate them whereas with numbers it
adds them so we want to concatenate the
first name with a space and then we want
to concatenate that with the last name
so we can create another reference
this time to the last-named property and
close it out so here we're referencing
two properties the first name in the
last name we're concatenating them using
the concatenation operator and between
them we're adding a literal value which
is just a space so when we confirm we
can see that we have recreated our
full-name property here now as I said
there's a function for every operator so
we saw the add function how that is a
substitute for the addition operator so
there's actually another way of
performing this concatenation we can use
the concat function and within it we can
reference the values that we want to
concatenate as it's argument so we'll
use the property function again and
first name and then our space and then a
last name so we have our full-name again
but this time generated using the concat
function now there's actually another
function that could perform the same
operation in a different way and produce
the same outcome and that is the join
function so with the join function
you'll use the join keyword and its
first argument is going to be the
character or a series of characters that
you want to use to separate the values
that you're combining or concatenating
so in our case we're just using a space
between them so we'll enter that literal
value there and then we can reference
those properties again starting with the
first name
and in the last name and here we have
our full names generated in a third way
but with the same value so that covers
our input values and we covered our
actions as well before we wrap up this
video I want to cover the importance of
value types so I've mentioned how the
plus sign serves a different role when
placed between two different types of
values when you place it between numbers
that's going to add those numbers when
you place it between text strings it's
going to merge or concatenate those text
strings so every operator and every
function is going to accept a certain
type of input as I said we talked about
numbers and text strings and those are
two of the four primary types of inputs
that notion is going to accept so as I
said numbers are one type they can be
integers or they can be floating-point
numbers which are numbers that have
decimals and then of course we mentioned
strings which are placed between
quotation marks and then we also have
dates and dates are values that are
generated using notions date property or
there's a special function that can
generate a date as well the now function
is the only function that accepts no
arguments and that's always going to
remain current with the current date so
when we calculated the players ages for
example we found the amount of time
between the players birthday in the
current date so to do that we used the
now function for the current date and
I'll go ahead and show you exactly which
formula we use to do that - even though
another video is going to cover that
same example among a variety of others
so we'll use our same property property
here so there is a function specifically
for finding the amount of time between
two dates it's called the day between
function and you'll see that when the
keyword for a function includes two
words it's going to use what's called
camel case where there's no spaces
between the two words the first word is
all lowercase but then subsequent words
begin with a capital letter so in this
case we have a lowercase date and then a
capital B for between so the arguments
for this date between function are going
to be the two dates that we want to find
the amount of time between so the first
one's going to be the later date in the
later date in our case is going to be
the current date so that's where we can
enter the now function and again it
accepts no arguments and then the
earlier date is going to be the player's
birthday so we're gonna reference the
players birthday using the prop function
and entering the name of the function of
the property which is birthday and then
the third argument is going to be the
units we want to use when we return the
amount of time between the two days so
for the players age we want to use years
and when we confirm our sample property
here returns all of the players ages and
you can see that because we were
referencing the players birthday
referencing another property which is
different for every player each age is
going to be different as well so the
fourth type of value you're going to be
working with is
million values and that's just true and
false and we already looked at how at
how notion renders true and false so
again you have numbers text strings or
just strings dates and boolean x' and
popping back over to our cheat sheet and
then scrolling up to our sub menu and
then selecting functions again when you
look at the arguments you're gonna see
exactly which value type the arguments
need to be so in most cases it's going
to be a specific type of argument in
some cases it can be any type of
argument any type of value but the vet
all the values will need to match so if
for example you don't follow these
guidelines and you try to use the wrong
value types or inconsistent value types
you're gonna get an error so if we were
to try to concatenate a number with a
text string for example you can see that
this is showing an error a type mismatch
error so that's why it's always
important to pay spec specially careful
attention to your value types and when
you make a property reference when you
reference another property that is going
to be inputting the value type of that
property you reference so when we
referenced the birthday it was inputting
a date property if we were when we
referenced the first name in the last
name it was inputting a string and if we
were to reference the age it would be of
the number type and so another trick to
keep in mind is that numbers are always
going to be aligned to the right as I
mentioned and strings to the left so if
you see a series of numbers but they're
aligned to the left
like we saw when we combined our two and
our two with our concatenation operator
this is actually gonna be a string and
so we can only use that in functions
that accept strings as their input value
types so that brings me to one last
example for this video which is our
combination of the string age with the
number H so we actually needed to
convert the number H to a text string in
order to combine it or concatenate it
with the string age so to convert a
number to a string or a string to not a
number notion offers two helpful
functions so when we combine that age
the string with the age the number we
use the format function to convert the
number age to string so to do that we
enter the string age our literal value
and then used our concatenation operator
and then we use the format function and
then a reference to the age property to
merge that texturing with the players
age and returning that gives us our
nicely labeled age which we can
reference in our gallery now if we were
to not use the format function and only
try to input the age property that's
going to give us that type mismatch
error again
so the the format property we use to
convert a number to a text string and
then we have the two number property
which again uses camelcase to convert
strings to numbers so we could in
but 24 within a string within quotation
marks to create a string and then
confirm and using the to number function
that's going to return a value of the
number type and we know that because
it's aligned to the right so in that
meet notions formula property post
there's another kind of sub navigation
and that sub navigation includes a link
to the importance of value types and
that's where I talk about these various
value types and I present those two
conversion functions that you can use to
convert those values so that wraps up
this introductory video as I mentioned
there's another video and that full post
includes a variety of examples of all of
these concepts in terms we just covered
and then another video is going to cover
the third question that you can ask at
the high at the high level when
composing your formulas which is when do
you want to perform certain actions in
other words which conditions need to be
met and which actions should you take as
an alternative if those conditions are
unmet so all of that will be available
in the YouTube video description as they
come about
you
you
Browse More Related Video
5.0 / 5 (0 votes)