Overview
Obsidian’s Bases (database) version 1.9.10 has been released, and I’m sure many people are wondering—what’s it good for?
This article introduces its usage with a simple example, while also serving as a step-by-step “follow-along” tutorial.
The Result
Let’s first look at what the database can achieve:
This vault is Kepano’s example vault
The purpose of this Base is quite simple: display other notes in the same folder as the current note. Perfect for when you’re browsing notes and want to quickly check out other related notes nearby.
Implementation
First, right-click in the file explorer and create a new Base file:
Create a new base
After creating it, give it a name, for example base-SameFolder:
Your first base
Then you’ll see the basic state of Bases: A table containing all files in your vault.
Next, we need to understand the two most important fundamental concepts: filters and properties.
Concepts
The most important part of the database is in the top operation area, which includes:
Top left:
- Views
- Results (including CSV export, result count limits, etc.)
Top right:
- Sort
- Filter
- Properties
- New
We’ll focus on the most important Filter and Properties first.
Filters
Filters define the “conditions for display”.
By default, all files will be listed, but too much information equals useless information. So we need to define what we want to see.
In this case, the condition is “in the same folder as the current note”.
Properties
Each file has its own specific properties. Properties can be used in “filter” conditions and also as “displayed information”. Besides the properties in the Properties area at the top of notes, there are also some implicit metadata, such as file paths, file folders, etc.
For this case, we need to get the folder property.
Practice
Specific Folder
Click the Filter button to open the filter UI.
We’ll open the “All views” filter and select: file | in folder, meaning “in a specific folder”.
Basic filter
Then we can manually enter a folder (path has auto-completion) to see the effect:
You can see that after this configuration, we can already display notes from a specific folder.
Let’s celebrate this important first step with your Base! ![]()
Formula: Dynamic Filter Conditions
But our goal is to display notes in the same folder as the current note.
We can’t manually modify the folder path every time, right? So we need more dynamic filter conditions.
First, click the </> button on the right:
Enter the advanced filter editing interface:
You can see that the filter condition has now become a formula: file.inFolder("References")
Its meaning is exactly the same as the previous filter: file is located in folder Reference.
The formula is somewhat like Javascript code, but relatively simple. You can learn by first building simple filters and then switching to advanced filters.
Here file refers to each file being tested—if it meets the condition, it gets listed in the results. So our next step is to replace the folder Reference with the actual current note's folder.
Specifically, replace "Reference" with this.file.folder:
You can try this modification first to see the result, then we’ll explain the theory.
About the Current File
If all goes well, after entering this, you’ll see files from the folder where the current base file is located:
(There might only be itself)
Now we need to introduce the special variable this— it represents the “current” file, but this “current” depends on where the Base is located.
For example, we’re currently editing the Base in the main editor, so this base-SameFolder.base is the current file.
But if we drag the base file to the sidebar and then click on the current note, things will change—
When the Base is in the sidebar or a split editor, this represents the currently active file.
This is a very important feature, and it’s based on this feature that we can achieve the “other notes in the current note’s folder” functionality.
Oh, by the way, in case you haven’t noticed, when you get to this point, you’ve already achieved the effect we wanted from the beginning ![]()
Congratulations! ![]()
Principles and Tips
In principle, our final filter condition: file.inFolder(this.file.folder) means we first use this.file to get the “file object” of the currently active note, then get its folder information through .folder.
Here’s a little tip: you can click Properties → Add Formula to add formula properties:
After entering file., you’ll see its various properties:
When you enter the complete file.folder, you can see this property for each file:
This is also a practical tip for testing bases formulas—try other properties too!
e.g. Full name of each file
Summary
This time we tried:
- Creating a new Base file
- Adding filter conditions to display the notes we want
- Moving the base to the sidebar to get dynamic filter results
- Understanding basic file properties
I hope this article serves as an easy start to your base journey. Have fun exploring!
Moi moi! ( ̄▽ ̄)ノ
Resources
Here are some related resources for extended learning.
Base Documentation
Bases syntax - Obsidian Help Basic syntax for bases. I recommend checking this documentation before (or after) practicing to get solid foundational knowledge.
In the Properties section, you can see introductions to note properties and file properties; On the Functions page, you can see introductions and applications of formulas/functions.
Example Vault
kepano/kepano-obsidian Kepano’s shared Obsidian example vault. He has converted all the filters in the vault to bases database format, where you can learn many usage patterns.














