skip to content
Jakob Osterberger

Obsidian Bases: Replacing My Dataview Journal

6 min read
Contents

My journal has run on Dataview since 2021. One note held the gallery, another held the “today one year ago” view. Each was a note with its own block of JavaScript, and each broke in its own way when a plugin update moved something.

The gallery and the memory view are one file now. A single .base file points at the journal folder and holds five views: cards for this year, cards for each past year, and today years ago. No JavaScript in any of them.

How Bases differs from Dataview

Dataview is a query language you embed in a note. The note is the result, so five results mean five notes.

A base is a saved filter over your vault. You define the filter once, add views to it, and switch between them from a dropdown in the same pane. None of the notes know the base exists.

The Bases view menu open, listing This Year, 2025, 2024, 2023 and Today Years Ago, with an option to add another view

With Dataview I wrote a query per view. With Bases I wrote the filter and formulas once, and each new view is a menu entry in the same file.

Dataview wanted dataviewjs past a simple table, and I looked that API up more often than I used it. Here it is condition rows, dropdowns, and YAML that Obsidian writes for you. Nothing of mine to fix when a plugin updates. If you know how to add a property to a note, you can build this.

What the base needs

  • Daily notes named YYYY-MM-DD. date(file.basename) parses the filename, so the date has to be in the name. They can live anywhere, as long as a folder or a tag tells the base where to look.
  • A mood property between 1 and 7.
  • Optional: a feature property with an image, for days worth looking at twice.
  • Optional: a today property with one line about the day.

Everything below is core Bases. No community plugin.

Filters and formulas

filters:
  and:
    - file.folder == "02_Journal"

formulas:
  cover: if(feature, feature, if(mood, ["#D6E2E9", "#BCD4E6", "#E1DBEB", "#F0EFEB", "#E9EDC9", "#FAEDCD", "#FFD7BA"][mood - 1], "#F0EFEB"))
  computed-title: if(today, today, file.name)

properties:
  formula.cover:
    displayName: computed-cover
  file.basename:
    displayName: Date
  file.name:
    displayName: Date

Every line there has a control in the UI: two condition rows for the exclusions, a formula editor with autocomplete, and a display name field per property.

The filter is a folder. 02_Journal is my folder name, not a requirement. Use yours, written as the path from the vault root.

If your daily notes are not in one folder, filter by tag instead of by path. Swap the folder condition for file.hasTag("journal") and drop the two exclusions. It matches nested tags too, so #journal/daily counts. The rest of the file does not change, as long as the filename still parses as a date.

cover is the card image, and it falls through three cases. If the note has a feature image, use that. Otherwise take the mood number, index into the colour list, and use the matching hex value. Otherwise a neutral grey. Mood 1 gives blue, mood 7 gives orange, and a year without photos still reads as colour at a glance.

The photos came along. A small script copied the old img:: inline fields into feature, so every day that had an image still shows that image, and the rest fall back to the colour. That was the whole cover migration.

computed-title reads the today property and falls back to the filename. That property is a plain note property, not the today() function, and the two coexist in the same file. One has parentheses, one does not, and I have mixed them up more than once.

The properties block renames things for display only. The formula shows up in the card settings as computed-cover, and the filename shows as Date.

The views

Two of the five, the ones that matter most:

views:
  - type: cards
    name: This Year
    filters:
      and:
        - file.basename.contains(today().year.toString())
    order:
      - today
      - file.name
    sort: []
    image: formula.cover

  - type: cards
    name: Today Years Ago
    filters:
      and:
        - date(file.basename).month == today().month
        - and:
            - date(file.basename).day >= today().day - 1 && date(file.basename).day <= today().day + 1
    order:
      - today
      - file.basename
    sort:
      - property: file.basename
        direction: DESC
    image: formula.cover

The year views are the same block with a different string: .contains("2024"), .contains("2023"), and so on. Each year is a duplicate of the view before it. order decides what sits on the card, image points at the formula above, and sort stays empty because the filter does the work.

Cards view of the 2026 journal, one card per day with the day's title, its date and a cover colour taken from the mood property

The memory view is the interesting one. It compares the month of every note to the current month, then keeps a three day window around today’s date: yesterday, today, tomorrow, for every year in the folder. Sorting descending puts the newest year first. The window exists because I write these late at night, and a note saved after midnight should still show up when I look at the page the next morning.

The Today Years Ago view showing journal entries from the same days in 2023, 2022 and 2021

The window does not wrap across a month boundary. On the 1st, today().day - 1 is zero and the last days of the previous month never match. I have hit that twice, shrugged, and left it.

What it costs

Each year still needs its own view. Nothing loops over years and there is no variable for one, so the step stays manual: duplicate last year’s view from the view menu, change 2025 to 2026 in the filter. Two clicks and one value, once a year.

The view settings panel with Layout set to Cards, an image property field and a Duplicate view option in the menu

Bases formulas are a fixed set of functions. Dataview had full JavaScript, which could do things Bases cannot. I have not needed any of those things for the journal, but the quote collection still needs real search across the vault, so that one stays where it is.

The .base file is plain YAML in the vault, so it goes into git with everything else. That was true of the Dataview notes too, but now there is one file to diff instead of three notes with embedded code.

The journal is one file and I open it more often. That is the whole test I have for a tool change, and this one passed it.


Related Posts


Jakob's Newsletter

Stay updated about my latest ideas, thoughts, journeys and projects. I'll send you the best of what I discover on the internet, what I've learned, and what I'm working on.

No spam, ever. Unsubscribe at any time.

Powered by Buttondown.

Enjoying the content?

Buy Me a Coffee at ko-fi.com