Featuring every NBA team and player, The NBA — in Notion showcases the power of Notion databases. It's an understandable, practical example of relations and views. Visitors can explore team rosters and filter players by college, country and other interesting criteria.
To duplicate the project within your own workspace, get the template.
This is a high-level snapshot of how it works and how we did it. For details about a particular piece of the puzzle, tweet us or reply to the newsletter.
The project comprises two databases — teams and players.
The first database, NBA Teams, contains the league's 30 teams. Each team has four properties:
Title
property, which we populated with the team name.Select
property with two options: Western Conference and Eastern Conference (colored consistently with their respective brands).Files & Media
property containing the logo from each team's ESPN.com profile.Relation
property connecting each team to its players.To populate the NBA Teams database in little time, we took the below steps. (Stumped by one? Tweet us us for a deeper dive or demo.)
https://a.espncdn.com/i/teamlogos/nba/500/[city-abbreviation].png
Therefore, we created a temporary column, City Abbr., and manually entered the abbreviation for each team's city.The second database, 2020 NBA Players, holds every NBA player of the 2019–20 season. The players have considerably more properties than the teams, but many of those properties are Formula
properties that combine and reformat other properties to be displayed in Gallery
views.
In the only tech-heavy step of this project, we wrote a function in Google Apps Script to parse the NBA Player List from NBA.com, then populate a Google Sheet with each player's name, team, number, position, school, nationality, height, birthday, age and headshot URL.
With the data in place, we downloaded the Sheet as a CSV file and imported it into Notion.
Of course, each NBA player is on an NBA team, and each team contains players. That's a prime use case for relational databases. By connecting players with teams via reciprocal Relation
properties, we ensure clean, consistent data. It also allows us to use Rollup
properties for interesting summaries, such as the total number of players on each team, or each roster's oldest and youngest players.
We initially populated the images with their source URLs — logos from ESPN.com, headshots from NBA.com. When we converted that URL
property to a Files & Media
property, the images imported automatically.
In Notion, each item in a database is a page, and Notion pages have icons. For the NBA Teams database, we made each team's logo its icon. This displays the logo next to the team name when it appears in databases (including Relation
properties, as we see in our player galleries), when linked within pages, and in the sidebar.
To make each team's logo its icon, we copied the value within the Logo property. This copied the URL of the image, which we could then paste into Link
when selecting the page icon.
The list of teams for each conference is an instance of the NBA Teams database — a Linked Database
. They are formatted as Lists
, Sorted
by Team (name) and Filtered
for the respective conference. Only the Team property is displayed (with the icon); the others are hidden.
The conference headings are images, borrowed from each conference's Wikipedia page.
To explore player profiles, we preconfigured a variety of Views
in the Gallery
format. Each is Sorted
by the Last Name property and Filtered
by Team or School. After creating one, we could simply duplicate it, rename it, and change the Filter
.
To display each player's information aesthetically, we created a handful of Formula
properties that combine and reformat the imported information.
For example, one property joins the player's number, position and height — separated by vertical bars. Others add helpful context, such as the words "school," "born," "age," and "draft."
With each headshot URL converted to an image, we were able to choose that Files & Media
property as the Card Preview
. In doing so, we toggled Fit Image
and opted for small card sizes.
Opening a team page below a conference displays its roster. That roster is a Linked Database
connected to the 2020 NBA Players database. It's formatted as a Gallery
, Sorted
by the Last Name property and Filtered
for the respective team.
After creating one, we could simply copy, paste and alter the Filter
.