Dataview plugin snippet showcase

In terms of integrating dataview queries in my daily notes, there are two things that are most important to me, and I’ve built them into my Daily Notes Template:

  1. A query that will reveal all the notes created on or last modified on that day. For this, I use “file.day” to generate a query based on the YYYY-MM-DD title of any given daily note. The advantage is that this never changes.
  2. A list of note titles that reflect every file that I’ve touched during that day. For this, “Last Modified” won’t work, since I might have created a note yesterday, work on it today, and then modify it again tomorrow. So I’ve resigned myself to doing a bit of manual review of the day (probably good to do anyway):
    1. At the end of the evening, run the query (by switching to Preview mode) for a LIST of “last modified in the past 18 hours”
    2. Copy the full list
    3. Switch back to Edit mode.
    4. Delete the dataview query
    5. Paste-as-text the clipboard
    6. Weed out unimportant files or modifications
    7. Wrap as links particularly key notes

This gives me static, persistent record of the notes I worked on in a particular day. I could use the “Text Expander” plugin for this, but it relies on Obsidian search, which doesn’t yet include dates (I believe).

Here are the dataview queries I use, and include in my Daily Note Template:

For the query for everything created or last modified on the YYYY-MM-DD date in the Daily Note title, and that remains as a dataview query:

dataview
TABLE file.mday AS “Last Modified”, file.cday AS “Date Created”
WHERE (file.mday = this.file.day) OR (file.cday = this.file.day)
SORT file.mtime asc

The improved version is below: Dataview plugin snippet showcase - #285 by AutonomyGaps

For the end-of-the-day query (which I then replace with the text):

LIST
FROM "" 
WHERE file.mtime >= date(today) - dur(18 hours)
SORT file.mtime asc

See also: @ryanjamurphy’s slightly different approach: Dataview plugin snippet showcase - #139 by ryanjamurphy

7 Likes