Creating a GPT to help me write Dataview queries in Obsidian

Why Dataview

I rarely use plugins in Obsidian in an effort to keep things as minimal and content-focused as possible. With the latest Obsidian update, I have been using Bases throughout my vault. I am using the digital garden plugin to publish notes which does not currently support this new file format. (Neither does Obsidian Publish currently.)

However, I still wanted a way to sum up my notes in a similar format to my Bases structure for the garden. Enter the Dataview plugin.

I've never used this plugin before, despite how popular it seemed to be prior to Bases. Something about having code queries side by side with your note content felt messy and too fragile.

But my garden is for navigating and rarely something I need to edit with dynamic tables in place to constantly pull my latest activity and published notes.

My Dataview query generator

I started using ChatGPT to write some of the queries that matched my Bases – sum up all notes with the "Recipes" tag, list my 8 most recent notes that are not attachments or templates, etc.

It performed well, so I asked Chat to write instructions for a custom GPT wherein I could type what I wanted in simple words and get a query I can paste in with no editing.

One caveat – Dataview queries are formatted with three tildes followed by "dataviewjs". Due to the way ChatGPT seems to format code in the interface, these are not included. So you will have to manually enter these, like so:

CleanShot 2025-09-27 at 15.11.38@2x.png

Here is a link to the GPT