Dataview plugin snippet showcase

A place to find and post code snippets used in the Dataview plugin created by Discord user blacksmithgu#1946.

Edit: In a recent update, various functions have been introduced! Checkout the docs to learn more about their usage.

Edit: I gave a live Obsidian Talk on the basics of Dataview, as well as some more advanced stuff. You can find the recordings of the live session here:

  • Part 1: Metadata and Basic-to-Intermediate Dataview
  • Part 2: More advanced Dataview stuff

I have notes for each of my university assessments, with the following frontmatter:

module: Qualitative Methodology
type: Exam
dueDate: '2021-02-27'
  - #Uni/Assessment

Using the dueDate field lets me have a list of upcoming assessments:

TABLE module, type, dueDate
FROM #Uni/Assessment
Where dueDate >= date(today)

Which shows this in my case:


Using a dataview list is also a nice way to link to a note without creating an actual link. This can be useful if you want to link to a lot of notes without cluttering your graphview.

This snippet links to the note I want


As you can see

But no permanent links are created, so the graphview doesn’t show these links.


I use a snippet like this to show literature used in a specific project. I use it together with the great Citations plugin that creates literature notes with metadata like author, title etc. in the YAML frontmatter. When I use a specific source in the project, I tag it with e.g. #literature/thesis. This way I can create something like a preliminary bibliography for a project (translated to English from German):

table authors as Author, title as Title, year as Year
from #literature/thesis 
sort authors


I also use the following on my “Index” (kind of a start page) to show recently edited and recently created files (excluding the Index file itself):

TABLE file.mtime as Edited
WHERE date(now) - file.mtime <= dur(3 days) and != ""
SORT file.mtime desc

TABLE file.ctime as Created
WHERE date(now) - file.ctime <= dur(3 days)
SORT file.ctime desc

Probably this will be more useful later, when live updating is added (it is on the roadmap on GitHub, if I’m right).

I don’t know who posted something like this first on the Discord, maybe it was @SkepticMystic? :smiley:

Edit: There was a bug before version 0.1.8 that required to write >= instead of <= in the examples above. I now adjusted it to work in 0.1.8 and later.


Nice! The Calendar plugin creator, Liam, wrote the original snippet :slight_smile:

How can I exclude stuff from search results? I tried using regular “-” with no success

I don’t think you can have something like:

LIST from -#Tag

But you can use the != operator in a WHERE query to exclude certain field values.

LIST from #Tag
WHERE dateCreated != date(today)

But how can I exclude tags and folders? Datecreated is a variable

Yes, I’m saying I don’t think that’s possible at the moment. Perhaps speak with the developer on the github repo or Discord.

1 Like

I send a pm to one of the devs that is here on the forum like 3 days ago but got nor reply. Hope they fix that soon, this plugin is a game changer

1 Like

I asked that question on Github. The developer said he will try to include it in the next release. Exclude folder in query · Issue #20 · blacksmithgu/obsidian-dataview · GitHub


Thank you

Hi @phlind . I have modified the code from @liam and @SkepticMystic to get what I want on my Dashboards. You get the path and filesize. Date(tommorow) is much better then Date(today) as it will also give the files you created today.

TABLE file.mtime as Modified, file.size, file.path as Path
WHERE date(tommorow) - file.mtime >= dur(2 days)
SORT file.mtime desc

I added your tip about excluding the index file.


Hi @Ward, thanks for the tip with tomorrow, but I think what you mean is that it’s better than today. now also gives me the files just created/edited.

1 Like

Hi @phlind . Of course :+1:. Thanx. I edit my post.

Would it be possible to create a dataview that creates an embedded list (ie which renders the page in preview mode) of files with a date title for each day, for use in a Daily Note. Phew what a sentence!
So, in a Daily Note: 1) an embedded link, 2) to other Daily Notes, 3) with the same date, 4) in previous years.

1 Like

I also would be nice If we were able to edit stuff in table view. it is way more convenient than opening notes to edit a single metadata.


I think that’s a really good feature request!

This would probably take a lot of work, and require the ability to write to notes; I don’t believe this is currently implemented. But I like the idea a lot!