|
Prefer to read (or listen to) this newsletter in your browser? Click here. Dataview has been a popular Obsidian plugin for a very long time, with over 3 million downloads since its initial release back in January of 2021. But it's always been slow and a little tricky to use. It's also in the process of being replaced by its work-in-progress successor (Datacore), which brings additional features but a whole new syntax. Bottom line? Now is a great time to migrate from Dataview to Obsidian Bases. In this newsletter, I'm going to walk you through how to do it (though if you want even more detailed step-by-step instructions, check out the blog post here. It's about 3000 words and includes some code samples as well.) The Link Between Bases & PropertiesThere are several different types of Properties you can use in Obsidian:
These properties are the key to using Bases. You'll want to make sure that you have these configured correctly in your vault and the values are up to date before you start creating Bases views. You can tell the type of Property by the icon next to the property name, and you can change the property type by clicking on this icon and selecting a new option from the drop-down list. Understanding Your Current Dataview QueriesMost Dataview queries are pretty straightforward. The Dataview Query Language usually includes up to five different components that make up the query.
Let's break these down before we look at how to implement them using Bases. The first thing in a Dataview query is usually the type of output you want. There are four different kinds of output:
Before you can do anything else in Dataview, you must select a query type. This is the only required field for a Dataview query, and unlike Bases, you can only choose one. Next, you need to define the source by using After you've defined the output type and the source, you need to define the filter using Next, you can define the order of the results rendered by the query using And lastly, you can group results together by using Recreating Dataview Queries in BasesThe easiest way to recreate your Dataview queries in Bases is visually. You can either create a new Either way, you'll get a rendered Bases query that shows all of the notes in your vault. From here, you can start bringing over the five different Dataview query components I outlined above. First is the output type, which in Bases is called a View. When you create a new Base, the type of output for the default view is automatically set to
Currently, there are only two view types you can choose from:
(This Cards View comes from my Obsidian Book Notes Library, and if you want to see me set the whole thing up, check out this YouTube video.) But one big advantage of Obsidian Bases is that you can actually have multiple views in the same Base. Once you create an additional view, you can apply specific filters to each and actually flip back and forth between them at will. Next is the source (which in Dataview was defined by using When adding these, you can use a couple of conditional statements:
For each filter, you choose the property you want, the conditional statement (i.e., is, is not, contains, etc.), and the value. You can choose from any of the properties you have in your notes, as well as a bunch of inherited properties (like created or modified time). And since you can have multiple views, you can also apply these filters for all views in the current Base or just the current view. For example, in my Obsidian Book Notes library, I have a filter for all views that shows all notes from the Book Notes folder, then I have another view that has an additional filter that only shows books where the rating is five stars.
Being able to combine views and filters like this is really powerful, and one of the biggest advantages of using Obsidian Bases over Dataview. When adding filters based on property values, you may want to list these values in either the Table or Cards views. To display these, click on the Properties button and just select the properties you want to make visible in the current view:
You can also edit the labels for any of these displayed Properties by clicking the carat and changing the display name.
Next, you can change the sort order of the results in your Obsidian Base by clicking the Sort button. You can sort by any of the available properties, and you can even add multiple properties here to apply different levels of sorting for larger queries.
The only thing we didn't cover yet is the grouping options from Dataview. And that's because you currently can't do anything with these in Bases. This is one area where Dataview is still better than Bases, though the public roadmap does show that grouping options are currently in development (along with List and Kanban views and even a Bases API). Using the Dataview to Bases ConverterThere's another way to convert your Dataview queries to Bases syntax by using a web tool called the Dataview to Bases converter. With this tool, you can paste your existing Dataview query in the box on the left, and the query instantly gets translated into the corresponding Bases syntax on the right:
From here, you can simply copy and paste this code into your note as an inline Bases code block that uses the same settings, sources, and filters as the original Dataview query. If you prefer, you can also download the syntax as a Personally, I think this tool is pretty great. If you just want a quick way to convert some of your simple Dataview queries, this free tool is perfect for you. — Mike |
A weekly newsletter where I help people apply values-based productivity principles and systems for personal growth, primarily using Obsidian. Subscribe if you want to make more of your notes and ideas.
Prefer to read (or listen to) this newsletter in your browser? Click here. 💡 The Big Idea: Mind Mapping is an Important Part of Any PKM System. You've been doing everything right with your PKM system. You're capturing notes. Creating links. Adding tags. Building your knowledge base in Obsidian. But when it comes time to actually CREATE something from all those notes? You hit a wall. That's because there's a gap between collecting information and generating insights. And there's a specific...
Prefer to read (or listen to) this newsletter in your browser? Click here. 💡 The Big Idea: Your PKM System Has to Have an Output. Recently, I read a newsletter by Ali Abdaal where he talked about an idea he called the creation-to-consumption ratio. It’s a simple formula: # of hours spent creating ÷ # of hours spent consuming For example, if you spent 10 hours consuming content made by other people in the last week and only 2 hours creating something of your own, you would have a .2 ratio. But...
Prefer to read (or listen to) this newsletter in your browser? Click here. 💡 The Big Idea: Not All Core Plugins Are Created Equal. Obsidian ships with a bunch of core plugins, but some are definitely more useful than others. This week, I completed a full tier list ranking of all 30 core plugins. My tier list rankings for all 30 Obsidian Core plugins. If you don't recognize the icons, it's because I made them all myself 😂 Here's the full breakdown of my Core plugin tier lists rankings: S Tier...