Obsidian for Score Study, Part 3

In the previous post we took a look at how to set up listening notes with rich metadata that can be queried later. In this post, we’ll explore how to set up a dataview table to make use of this information!

Dataview is a third-party plugin developed for Obsidian that enables users to run powerful queries over the notes in their Obsidian vault, creating lists or tables that will automatically tabulate and stay updated. Dataview is one of the few Obsidian plugins that I couldn’t live without, and I encourage everyone I coach to install and use it!

The table for my listening list is actually very simple:

```dataview
table composer as Composer, title as Title, scoring as Scoring, star as Star, return as Return
from #listening/done
sort Composer asc
``` (the dataview table ends at these three backticks)

The first thing to do us enter three backtick characters in a row. This tells Obsidian that you’re about to enter some code for it to evaluate.

Immediately after the first three backticks, we enter dataview to tell Obsidian that we want the code block to be evaluated by our dataview plugin.

At that point we can get to work setting up a table with some columns of information and criteria.

We tell dataview that we’ll create a table element and then ask dataview to fetch some of the fields that we discussed in the previous post. In this case, we’re creating the column Composer by taking information from the composer field in our listening notes. Observe that if we wanted to, we could call the field something like author in the listening note and could access this field here in dataview through the statement author as Composer rather than composer as Composer. Or (if we didn’t want this field to appear as “Composer” at the top of our dataview table) we could do something like composer as Author or composer as "Cool Human" or composer as "My Very Favorite People Who Write Music". Note that you’ll need to use quotation marks to display dataview column headers that are more than one word long.

Next, we need to tell dataview what notes to query. In this case from #listening/done tells dataview to pull information only from notes that have the tag #listening/done. In my vault, I use a variety of tags to reflect listening notes in different states: #listening/in-progress, #listening/pending, etc.

After this, we can make the table a little easier to use by asking dataview to sort entries based on a certain column. In this case, I find it helpful to use the name of the composer as a sorting system. My entries are formatted as Last, First, but there’s nothing to keep you from creating composer_first:: and composer_last:: fields so that you can sort your table with sort composer_last asc.

As you may have guessed the asc indication tells Dataview to sort the entries in ascending order. You can use desc for descending order.

Finally, we will complete our Dataview code block by adding in another three backticks at the very end.

When everything is working correctly, your table should look something like this:

And with that we’ve successfully set up a personal score study database, ready to collect our thoughts and observations on all sorts of music!

If you’re interested in learning more about Obsidian or even getting set up in the software for the first time, consider taking a moment to schedule a coaching session. These hour-long sessions are a casual, exciting way to dive into this powerful software!

Posts mentioning this post: