Meet Notion's Formula Property: Part 1

William Nutt
15 Mar 202030:38

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

00:00

πŸ“š 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.

05:02

πŸ”’ 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.

10:03

🧩 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.

15:05

πŸ“ 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.

20:07

πŸ”‘ 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.

25:09

🚫 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

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 is a powerful tool for creating dynamic and calculated content within a Notion workspace. In the video, it is 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 from their birthday.

πŸ’‘Literal Values

Literal values in the context of Notion's formula property are fixed inputs that do not change from one database item to another. They are directly entered into the formula and used in every iteration, making them ideal for consistent elements like labels or titles. For example, in the script, '2 & 2' are literal values used to demonstrate a basic arithmetic operation within a formula.

πŸ’‘Property Reference

Property reference is the method by which a formula in Notion accesses the values of other properties within the same database item. This allows for dynamic and unique outputs for each item based on its specific property values. The script demonstrates this by showing how to concatenate a first name and last name from separate properties to create a full name.

πŸ’‘Concatenation Operator

The concatenation operator in Notion's formula property is used to combine or merge text strings. When the plus sign is placed between two strings of text, it concatenates them instead of performing arithmetic addition. This is shown in the script where '2 & 2' within quotation marks results in the text '2 & 2' rather than the numeric sum of 4.

πŸ’‘Functions

Functions in Notion's formula property are pre-defined operations that can be used to perform more complex calculations or manipulations than basic operators. They consist of a keyword followed by parentheses containing the required arguments. Functions can take one or more arguments and can be categorized into logic, numeric, text, and date/time functions. An example from the script is the 'add' function, which performs addition, similar to the arithmetic operator '+' but within the context of a formula.

πŸ’‘Operators

Operators in the formula property are symbols that perform actions on values in a formula. They include arithmetic operators like '+' for addition and '-' for subtraction, as well as concatenation operators when used with text strings. Operators are fundamental to defining actions within a formula, as shown in the script where the addition operator is used to sum two numbers or concatenate two text strings.

πŸ’‘Value Types

Value types refer to the different kinds of data that can be used in Notion's formula property, including numbers, text strings, dates, and boolean values. Each operator and function in Notion expects certain value types as inputs, and using the incorrect type can result in errors. The importance of value types is emphasized in the script, with examples of how operators behave differently with numbers versus text strings.

πŸ’‘Constants

Constants in the context of Notion's formula property are fixed values like mathematical constants (e.g., pi) or boolean values (true/false) that can be used in formulas. They are less frequently used compared to literal values or property references but can be useful for advanced calculations or specific conditions. The script mentions constants as part of the inputs that can be used in formulas.

πŸ’‘Conditions

Conditions in Notion's formula property are used to define when certain actions should be taken within a formula. They allow for alternative actions based on whether specific conditions are met. While not fully explored in the provided script, conditions are mentioned as a topic for a later video, highlighting their importance in creating more complex and versatile formulas.

πŸ’‘Cheat Sheet

The cheat sheet mentioned in the script is a resource that includes every Notion function, operator, and constant with descriptions and examples. It serves as a quick reference guide for users to understand how to format dates, use different functions, and troubleshoot common issues. It is a valuable tool for users looking to master the use of formulas in Notion.

πŸ’‘Gallery View

Gallery view in Notion is a way to display database content in a visually appealing card format. In the context of the script, it is used to show how calculated values, such as a player's full name or labeled age, can be displayed within the gallery view for better readability and context. The script demonstrates how formulas can enhance the presentation and understanding of data in 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

play00:00

the formula property is one of notions

play00:02

most powerful yet underutilized features

play00:05

with this brief introduction and a

play00:07

little bit of practice users at all

play00:09

levels can use formulas to bolster their

play00:12

notion workspaces and as you get to know

play00:15

and work with formulas you might want to

play00:17

reference three resources available on

play00:19

notion VIP so the first is opposed

play00:23

called meet notions formula property

play00:25

that's going to correspond with this

play00:27

video the second is a collection of

play00:30

simple and useful formula examples that

play00:32

will also have a corresponding video and

play00:34

then the third will probably prove most

play00:37

beneficial to you in the long run and

play00:39

that's a cheat sheet that includes every

play00:41

notion function operator and constant

play00:44

with a description and an example and it

play00:48

also includes the patterns that you'll

play00:50

use to format your dates within notion

play00:53

formulas so what is this formula

play00:59

property well like the other properties

play01:02

you're used to working with like texts

play01:05

and number and date the formula property

play01:09

is going to contain a unique value for

play01:11

each item in your database but unlike

play01:14

those other properties where you

play01:15

manually input the value for each item

play01:18

in the database the formula property is

play01:21

going to generate its values

play01:22

automatically and it does that by

play01:25

conducting a series of operations that

play01:27

you define and you define those

play01:30

operations by writing a formula and that

play01:32

formula is going to execute on each item

play01:36

in your database and oftentimes it's

play01:40

going to reference other properties for

play01:42

each of those items and so because those

play01:45

properties are gonna vary from item to

play01:48

item the output of your formulas will

play01:51

vary as well so let's take a look at an

play01:55

example to write a formula you'll create

play02:00

a new property just like any other

play02:01

property and for the type you'll choose

play02:04

formula

play02:09

to compose your formula and you can

play02:10

either click the top of the property and

play02:13

choose edit formula or you can click any

play02:16

cell beneath it and that's going to open

play02:18

up this formula composition window so a

play02:22

formula can be as simple as two plus two

play02:25

or it can really be as simple as just

play02:27

the number two or the value of true but

play02:31

we'll type two plus two as our first

play02:33

formula here and then after typing your

play02:37

formula you can click the done button or

play02:40

you can hold command or ctrl on your

play02:43

keyboard depending on what type of

play02:44

computer you're using and then hit

play02:46

return or enter so here we have four

play02:51

returned for every item in our database

play02:54

and the reason is we entered what's

play02:56

called literal values we used a 2 and a

play03:00

2 for our values so that's going to be

play03:02

the value that your formula uses in

play03:04

every iteration for every item in the

play03:08

database but as I mentioned you're

play03:10

typically going to reference values from

play03:13

other properties in the database so when

play03:16

the formula executes on each item it

play03:19

will use that items respective values

play03:23

for those properties in order to

play03:25

generate a unique output so that'll make

play03:28

the output different for most items

play03:31

so our first formula returned a bunch of

play03:34

fours which are useless to us so what is

play03:37

useful about the formula property well

play03:40

you're going to use formulas for kind of

play03:42

two overarching reasons the first is to

play03:45

calculate new values from the values of

play03:48

other properties so let's look at a

play03:50

couple of quick examples of that in our

play03:54

database of players that comprise a

play03:57

basketball team we're given the last

play04:00

name in the first name and then using a

play04:03

formula we can combine the last name in

play04:05

the first name to create the full name

play04:09

in another example were given the

play04:13

player's birthday and by finding the

play04:16

amount of time between the birthday and

play04:18

the current date and time were able to

play04:21

calculate the players age

play04:23

and then moving down to our database of

play04:26

orders from an online store we can see

play04:30

that we are given the tax rate and then

play04:35

each item has an independent price and

play04:38

so by multiplying the price and the tax

play04:41

rate we know exactly how much tax to add

play04:44

to the price of each item and then we

play04:47

can calculate the total price of each

play04:49

item by adding the tax and the original

play04:53

price

play04:54

so the second overarching use of

play04:57

formulas is going to be to reformat

play04:59

values so we mentioned that we'll be

play05:02

using patterns to format dates but one

play05:05

of my favorite uses of this reformatting

play05:08

approach is using notions gallery view

play05:12

so if we look at our player roster in

play05:15

the gallery view we can see that we have

play05:18

the player's headshot as the card cover

play05:21

and then we're using that calculated

play05:23

full name within the players information

play05:27

and then we also have this arbitrary

play05:29

number we're not quite sure what it

play05:32

means we're inclined to think that it

play05:34

probably corresponds with the players

play05:35

jersey number but in reality that's the

play05:38

players age so using a formula we can

play05:42

append some helpful context to that age

play05:44

we can add the term age with a colon

play05:47

that will allow us to understand exactly

play05:51

what that number means so we already

play05:55

have this pre configured here let's swap

play05:58

out the standalone age and include the

play06:04

labelled age and there we have a very

play06:06

nicely contextualized age for each

play06:10

player on our roster so we have a

play06:14

glimpse into what the formula property

play06:15

is and why it's useful

play06:17

let's explore exactly how it works so

play06:21

when you compose a formula you're gonna

play06:23

answer one or more of three kind of

play06:25

high-level questions you're gonna answer

play06:27

do what what are the actions that you

play06:30

want the formula to take to what what

play06:32

are the input values on which you want

play06:34

those actions to be taken and

play06:36

when what conditions need to be met in

play06:39

order for those actions to be taken and

play06:41

then you can also define alternative

play06:43

actions to be taken when those

play06:45

conditions are unmet so we're going to

play06:48

cover the first two here in this video

play06:50

and then a later video we'll cover the

play06:53

conditions question so let's start with

play06:56

the actions when you compose your

play06:59

formula you can define your actions in

play07:01

one of two ways you can use operators or

play07:05

you can use functions so let's start

play07:08

with operators operators are very simple

play07:10

you're already familiar with them so I

play07:11

don't want to over complicate them here

play07:13

an operator is simply the plus sign that

play07:17

we use to add two in to an operator is a

play07:20

character that you place between two

play07:23

values to perform an action on those

play07:26

values so the plus sign performs

play07:28

addition the minus sign performs

play07:30

subtraction we have the star character

play07:33

to perform multiplication the backslash

play07:36

to perform division and then we can use

play07:38

the percent sign to return the remainder

play07:42

after division so if you go over to that

play07:46

cheat sheet at notion dot VIP

play07:49

slash formulas at the top you'll find

play07:53

kind of a sub navigation menu and within

play07:55

that menu you'll find operators so if

play07:59

you click on the operators that's going

play08:00

to jump down the page to a list of those

play08:03

operators that I just described so the

play08:07

way that I described those operators

play08:09

where they're placed between two numbers

play08:12

to perform an action on those numbers

play08:13

that makes them arithmetic operators and

play08:17

that's the largest number of operators

play08:20

but I mentioned that when you place that

play08:24

plus sign between two numbers such as

play08:26

the two and two it performs addition on

play08:29

them making it an arithmetic operator

play08:32

but if you place that plus sign between

play08:34

two strings of text it's going to

play08:37

combine those two strings or it's going

play08:40

to concatenate them and that makes the

play08:42

plus sign in that instance a

play08:44

concatenation operator rather than an

play08:46

arithmetic operator

play08:49

so let's take a quick look at the use of

play08:51

an operator of course we've already

play08:54

added 2 & 2

play08:56

when we did so we were using the

play08:58

addition operator and arithmetic

play09:00

operator but if we were to place those

play09:06

two twos within quotation marks that

play09:10

makes them strings they're not

play09:12

technically numbers and we're gonna

play09:13

explore value types here in just a

play09:16

little bit but when we confirm this

play09:20

formula we're gonna see 2 & 2 here

play09:23

returned by our formula and they're

play09:26

aligned to the left rather than to the

play09:29

right meaning that they are a text

play09:32

string rather than a number that can be

play09:34

used as a input with arithmetic

play09:38

operators so that's operators let's dive

play09:42

into functions so if functions are kind

play09:45

of like packaged series of operations

play09:48

and they consist of a keyword followed

play09:51

by a set of parentheses and within those

play09:53

parentheses you put your inputs in the

play09:57

case of functions those inputs are known

play09:59

as arguments in every function can

play10:02

accept one two three or virtually

play10:05

unlimited arguments so going back over

play10:10

to our cheat sheet scroll back up to the

play10:13

top and then look again at our sub

play10:18

navigation menu you can see here that we

play10:20

have a functions category and within

play10:23

that category you can see that we have

play10:25

four different types of functions so we

play10:28

have logic functions numeric functions

play10:31

text functions and date and time

play10:34

functions and generally those types of

play10:36

functions are going to correlate with

play10:38

the types of inputs or arguments that

play10:41

those functions accept or the types of

play10:43

values that they return so if we jump

play10:49

down the page we can see a full list of

play10:53

notions functions and you can see that

play10:57

they consist of that keyword followed by

play11:00

a set of parentheses

play11:02

so each of these functions within this

play11:05

cheat sheet are gonna include a brief

play11:07

description an example and then a list

play11:11

of that functions arguments you can see

play11:13

how many arguments the function takes

play11:15

and you can see exactly what those

play11:18

arguments need to be so let's look at a

play11:22

function so actually there's a function

play11:28

that corresponds with each operator that

play11:31

we just discussed so we added the

play11:33

numbers two and two using the addition

play11:36

operator but there's actually a function

play11:38

called add add is the keyword and then

play11:43

within the parentheses for its arguments

play11:45

we could just put two and two again and

play11:49

you're gonna separate a functions

play11:51

arguments with a comma so when we

play11:54

confirm this formula we're gonna see

play11:57

that we have our useless series of fours

play11:59

here again but it came about those fours

play12:02

in a different way rather than using the

play12:05

addition operator it used the add

play12:09

function and as you saw there are a

play12:14

variety of different functions that

play12:16

perform a variety of different types of

play12:18

operations on their inputs and we're

play12:21

gonna be looking at a few examples

play12:23

throughout the rest of this video but

play12:25

another video covers a collection of

play12:31

simple and useful examples and as I

play12:33

mentioned there's also that

play12:34

corresponding post on notion VIP and

play12:38

that's linked within the youtube video

play12:41

description so those are our actions

play12:46

operators and functions are the way that

play12:48

we tell a formula what we want it to do

play12:52

so let's move on to input values what

play12:56

are the values on which we want those

play12:59

actions to be taken and there's three

play13:03

different types of input values that you

play13:06

can provide a formula we've already seen

play13:09

literal values so let's explore them

play13:11

briefly here first so as I mentioned

play13:15

when

play13:16

- and - whether using the operator or

play13:20

the function those twos are literal twos

play13:23

we input them directly into the formula

play13:27

and because they don't reference another

play13:29

property those two and twos are going to

play13:33

be the inputs for every iteration of the

play13:35

formula so as I've said that's kind of

play13:40

useless here in this example but we did

play13:43

see a useful example of literal values

play13:47

and that's when we created our labelled

play13:49

age property when we added the text

play13:52

string age to the age the actual age

play13:57

which is a reference to the age property

play13:59

that texturing was a literal value it's

play14:03

the same for every iteration of this

play14:07

formula and we want it to be that way

play14:08

because we want that term age to appear

play14:12

within our player gallery for every

play14:15

player so that's a useful example of

play14:19

literal values so we also have the

play14:24

option to use constants as our inputs

play14:27

and constants you're not going to use

play14:28

very frequently so I won't spend a lot

play14:30

of time on it but notion offers a

play14:33

collection of mathematical constants

play14:35

such as pi you may be familiar with to

play14:38

perform more advanced calculations so

play14:41

those constants if you're interested are

play14:44

also available on the cheat sheet back

play14:49

up at our sub menu we can see that we

play14:53

have a constants options here at the

play14:55

bottom and here's a list of constants so

play14:58

technically true and false are constants

play15:01

as well and true and false are

play15:04

interesting in notion because when a

play15:07

formula returns the value of true or

play15:09

false it's going to display that output

play15:12

as a checkbox so false is just going to

play15:17

show an empty checkbox and then true is

play15:21

going to show a check checkbox and of

play15:26

course when you just use that value for

play15:27

every iteration

play15:29

of the formula it doesn't it doesn't

play15:32

offer much purpose but you can imagine

play15:36

that if we're using conditions and we

play15:39

want to say if this this and this are

play15:41

true check the box otherwise leave it

play15:44

unchecked then this rendering of true

play15:47

and false can be helpful so those are

play15:51

literal values in constants but most

play15:53

often your formulas are gonna reference

play15:55

other properties for its input values so

play16:00

each time your formula performs its

play16:03

operations on an item in your database

play16:06

it's gonna reference the properties for

play16:08

that specific item and because the

play16:11

values of those properties will differ

play16:13

from item to item the way that your

play16:17

formulas use it within its operations is

play16:20

going to differ as well and that will

play16:22

create a different output for each item

play16:24

in your database so let's see exactly

play16:28

how that works to verb to reference

play16:33

another property there's a special

play16:35

function the function uses the prop

play16:38

keyword and then you'll open its

play16:41

parentheses and for its argument you're

play16:43

gonna input the name of the property

play16:45

that you want to reference within

play16:47

quotation marks so we created the full

play16:52

name by combining the first name and the

play16:55

last name along with the space between

play16:58

them so we referenced the first name in

play17:03

the last name to do that so let's look

play17:05

exactly how we may have done that with

play17:08

the prop function we can include first

play17:11

name and then we can use that plus sign

play17:18

and remember when placed between strings

play17:22

of text that's going to combine them or

play17:24

concatenate them whereas with numbers it

play17:27

adds them so we want to concatenate the

play17:32

first name with a space and then we want

play17:35

to concatenate that with the last name

play17:39

so we can create another reference

play17:43

this time to the last-named property and

play17:47

close it out so here we're referencing

play17:51

two properties the first name in the

play17:53

last name we're concatenating them using

play17:56

the concatenation operator and between

play18:01

them we're adding a literal value which

play18:06

is just a space so when we confirm we

play18:09

can see that we have recreated our

play18:12

full-name property here now as I said

play18:19

there's a function for every operator so

play18:22

we saw the add function how that is a

play18:25

substitute for the addition operator so

play18:29

there's actually another way of

play18:30

performing this concatenation we can use

play18:34

the concat function and within it we can

play18:38

reference the values that we want to

play18:40

concatenate as it's argument so we'll

play18:44

use the property function again and

play18:47

first name and then our space and then a

play18:55

last name so we have our full-name again

play19:04

but this time generated using the concat

play19:08

function now there's actually another

play19:11

function that could perform the same

play19:14

operation in a different way and produce

play19:17

the same outcome and that is the join

play19:20

function so with the join function

play19:23

you'll use the join keyword and its

play19:26

first argument is going to be the

play19:28

character or a series of characters that

play19:30

you want to use to separate the values

play19:33

that you're combining or concatenating

play19:35

so in our case we're just using a space

play19:38

between them so we'll enter that literal

play19:40

value there and then we can reference

play19:44

those properties again starting with the

play19:46

first name

play19:50

and in the last name and here we have

play19:57

our full names generated in a third way

play20:01

but with the same value so that covers

play20:06

our input values and we covered our

play20:09

actions as well before we wrap up this

play20:12

video I want to cover the importance of

play20:14

value types so I've mentioned how the

play20:17

plus sign serves a different role when

play20:21

placed between two different types of

play20:23

values when you place it between numbers

play20:25

that's going to add those numbers when

play20:28

you place it between text strings it's

play20:30

going to merge or concatenate those text

play20:35

strings so every operator and every

play20:39

function is going to accept a certain

play20:43

type of input as I said we talked about

play20:47

numbers and text strings and those are

play20:49

two of the four primary types of inputs

play20:53

that notion is going to accept so as I

play20:59

said numbers are one type they can be

play21:02

integers or they can be floating-point

play21:04

numbers which are numbers that have

play21:06

decimals and then of course we mentioned

play21:09

strings which are placed between

play21:11

quotation marks and then we also have

play21:14

dates and dates are values that are

play21:18

generated using notions date property or

play21:22

there's a special function that can

play21:26

generate a date as well the now function

play21:29

is the only function that accepts no

play21:32

arguments and that's always going to

play21:34

remain current with the current date so

play21:38

when we calculated the players ages for

play21:43

example we found the amount of time

play21:46

between the players birthday in the

play21:49

current date so to do that we used the

play21:51

now function for the current date and

play21:57

I'll go ahead and show you exactly which

play22:00

formula we use to do that - even though

play22:02

another video is going to cover that

play22:04

same example among a variety of others

play22:08

so we'll use our same property property

play22:15

here so there is a function specifically

play22:19

for finding the amount of time between

play22:21

two dates it's called the day between

play22:28

function and you'll see that when the

play22:31

keyword for a function includes two

play22:33

words it's going to use what's called

play22:35

camel case where there's no spaces

play22:37

between the two words the first word is

play22:41

all lowercase but then subsequent words

play22:43

begin with a capital letter so in this

play22:45

case we have a lowercase date and then a

play22:47

capital B for between so the arguments

play22:52

for this date between function are going

play22:57

to be the two dates that we want to find

play23:00

the amount of time between so the first

play23:02

one's going to be the later date in the

play23:04

later date in our case is going to be

play23:06

the current date so that's where we can

play23:08

enter the now function and again it

play23:11

accepts no arguments and then the

play23:15

earlier date is going to be the player's

play23:17

birthday so we're gonna reference the

play23:19

players birthday using the prop function

play23:23

and entering the name of the function of

play23:25

the property which is birthday and then

play23:28

the third argument is going to be the

play23:31

units we want to use when we return the

play23:35

amount of time between the two days so

play23:37

for the players age we want to use years

play23:40

and when we confirm our sample property

play23:46

here returns all of the players ages and

play23:49

you can see that because we were

play23:52

referencing the players birthday

play23:55

referencing another property which is

play23:57

different for every player each age is

play24:00

going to be different as well so the

play24:04

fourth type of value you're going to be

play24:07

working with is

play24:09

million values and that's just true and

play24:10

false and we already looked at how at

play24:13

how notion renders true and false so

play24:17

again you have numbers text strings or

play24:23

just strings dates and boolean x' and

play24:27

popping back over to our cheat sheet and

play24:30

then scrolling up to our sub menu and

play24:35

then selecting functions again when you

play24:37

look at the arguments you're gonna see

play24:40

exactly which value type the arguments

play24:43

need to be so in most cases it's going

play24:46

to be a specific type of argument in

play24:47

some cases it can be any type of

play24:51

argument any type of value but the vet

play24:55

all the values will need to match so if

play25:01

for example you don't follow these

play25:04

guidelines and you try to use the wrong

play25:08

value types or inconsistent value types

play25:11

you're gonna get an error so if we were

play25:14

to try to concatenate a number with a

play25:20

text string for example you can see that

play25:24

this is showing an error a type mismatch

play25:28

error so that's why it's always

play25:30

important to pay spec specially careful

play25:33

attention to your value types and when

play25:37

you make a property reference when you

play25:40

reference another property that is going

play25:43

to be inputting the value type of that

play25:46

property you reference so when we

play25:47

referenced the birthday it was inputting

play25:50

a date property if we were when we

play25:52

referenced the first name in the last

play25:54

name it was inputting a string and if we

play25:58

were to reference the age it would be of

play26:03

the number type and so another trick to

play26:12

keep in mind is that numbers are always

play26:14

going to be aligned to the right as I

play26:16

mentioned and strings to the left so if

play26:18

you see a series of numbers but they're

play26:21

aligned to the left

play26:23

like we saw when we combined our two and

play26:26

our two with our concatenation operator

play26:30

this is actually gonna be a string and

play26:33

so we can only use that in functions

play26:36

that accept strings as their input value

play26:41

types so that brings me to one last

play26:46

example for this video which is our

play26:51

combination of the string age with the

play26:54

number H so we actually needed to

play26:58

convert the number H to a text string in

play27:02

order to combine it or concatenate it

play27:06

with the string age so to convert a

play27:09

number to a string or a string to not a

play27:13

number notion offers two helpful

play27:16

functions so when we combine that age

play27:22

the string with the age the number we

play27:26

use the format function to convert the

play27:30

number age to string so to do that we

play27:37

enter the string age our literal value

play27:39

and then used our concatenation operator

play27:42

and then we use the format function and

play27:46

then a reference to the age property to

play27:55

merge that texturing with the players

play27:59

age and returning that gives us our

play28:03

nicely labeled age which we can

play28:05

reference in our gallery now if we were

play28:06

to not use the format function and only

play28:11

try to input the age property that's

play28:14

going to give us that type mismatch

play28:16

error again

play28:17

so the the format property we use to

play28:21

convert a number to a text string and

play28:24

then we have the two number property

play28:28

which again uses camelcase to convert

play28:32

strings to numbers so we could in

play28:36

but 24 within a string within quotation

play28:42

marks to create a string and then

play28:47

confirm and using the to number function

play28:50

that's going to return a value of the

play28:55

number type and we know that because

play28:57

it's aligned to the right so in that

play29:06

meet notions formula property post

play29:12

there's another kind of sub navigation

play29:17

and that sub navigation includes a link

play29:20

to the importance of value types and

play29:23

that's where I talk about these various

play29:25

value types and I present those two

play29:29

conversion functions that you can use to

play29:33

convert those values so that wraps up

play29:37

this introductory video as I mentioned

play29:39

there's another video and that full post

play29:41

includes a variety of examples of all of

play29:44

these concepts in terms we just covered

play29:46

and then another video is going to cover

play29:50

the third question that you can ask at

play29:55

the high at the high level when

play29:57

composing your formulas which is when do

play30:01

you want to perform certain actions in

play30:04

other words which conditions need to be

play30:05

met and which actions should you take as

play30:08

an alternative if those conditions are

play30:11

unmet so all of that will be available

play30:15

in the YouTube video description as they

play30:18

come about

play30:25

you

play30:32

you

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
NotionFormula PropertyAutomationData ManagementProductivityDatabaseCalculationsReformattingWorkflowEfficiency