## Introduction This article continues the series on automating Daily Notes in Obsidian. This time we explore including Dataview queries in the Daily Note template so certain information appears every time we create a Daily Note. The examples to be used here will be to create three queries. The first is a reminder for articles I intend to write. The second shows me all notes I have created on the date of the Daily Note and the third shows all notes I have worked on or modified on that day. Bear in mind that these are just examples that suit my particular needs and you can use dataview to include all sorts of different queries. References to help and assistance will be included at the foot of this article. ## Callouts in Obsidian I always put my Dataview queries in Callouts. This is just a personal preference because I can hide the query results or have them display by default. The callouts also display in a manner that creates contrast in my notes. You can find out more about callouts in another article I have written on [compacting Obsidian notes](https://ricraftis.au/obsidian/how-to-use-folding-and-callouts-in-obsidian-maps-of-content-mocs-for-compact-appearance/). Obsidian has quite a number of callouts you can use. You might like to explore the Community Plugin "[Callout Manager](https://github.com/eth-p/obsidian-callout-manager)" for ideas. For the purposes of this article however, we will confine ourselves to a simple callout. ## 1\. Articles to Write This dataview query is based on a tag in any note I start where I intend to write an article. If you have followed other examples of videos and articles you will be familiar with putting the following frontmatter at the top of your note via a template so it appears in every new note. Refer to [this article]([[How To Structure Your Notes In Obsidian With A Template]]) for more information. up:: Link to next note up the hierarchical chain tags:: # todo/write (remove space between hash and first letter) For every article I intend to write, I create a note as a placeholder and structure it with that tag. Once the article is written, the # todo/write tag is removed in the publishing process. So back to the Daily Note. In the area where you wish to have these articles insert the following code assuming you are using the same tag mentioned above. ``` >[!EXAMPLE] Articles To Write >LIST >FROM #todo/write >SORT file.name asc ``` **Figure 1: Result of code above** ![[resultOfArticleToWritie.png]] **Source: Screenshot by author** If you don't want the callout to be displayed in full view, then add a minus sign after the closing bracket of EXAMPLE. Once you exit the code area, the callout should display as follows. ### Option Another method of doing something like this is to create a specific note called "Articles to Write" or whatever it is you wish to keep track of. Put the dataview query in that note and then create a Bookmark using Obsidian's new core plugin to take you to that specific note. Nick Milo has just made an [excellent video](https://youtu.be/mcrcRXp5d8A) on this new feature. ## 2\. Notes Created Today This callout will automatically record all new notes you have created today. I keep this at the bottom of my Daily Note. The code for this is very simple: ``` >[!EXAMPLE]+ New Today >LIST >WHERE file.cday = this.file.day >SORT file.name asc ``` This query is simply searching for all files where the creation date (file.cday) is equal to today (this.file.day) and then sorts the files in ascending order. Done correctly, it should display similar to the below example. **Figure 2: Result of code above** ![[newNotesToday.png]] **Source: Screenshot by author** ## 3\. Note Modified Today A similar query to the one above but tells you all the files you have worked on today. This will include any you have created because you have worked on them too. The code to generate this callout is: ``` >[!EXAMPLE]+ Modified Today >LIST >WHERE file.mday = this.file.day >WHERE !contains(file.path, "91.23 - 2023") >SORT file.name asc ``` This query is looking for files modified (file.mday) that equal today (this.file.day) and are not located (!contains) in the folder where I keep all my Daily Notes (file.path, 91.23 - 2023) and then sorts the files in ascending order. **Figure 3: Result of code above** ![[modifiedNotesToday.png]] **Source: Screenshot by author** ## Conclusion These are just a couple of examples of what can be done in your Daily Notes, or other notes for that matter, with Dataview queries. It is a very powerful plugin and we have only just scratched the surface. Some people write some truly amazing queries using the plugin. So good luck with these beginner queries and I hope it adds some interesting viewing to your Daily Note that is automated. ## Bonus Video <div class="video-container"> <iframe width="560" height="315" src="https://www.youtube.com/embed/U-acSbdvP-8?si=q78bnNwQdLcRrIHo" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> </div> <iframe src="https://tally.so/embed/3j55DQ?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1" width="100%" height="500" frameborder="0" marginheight="0" marginwidth="0"> </iframe> ### References [Basic Dataview Query Builder](https://s-blu.github.io/basic-dataview-query-builder/) [Obsidian Callout Plugin](https://github.com/eth-p/obsidian-callout-manager) (but available by browsing Community Plugins in Obsidian) Nick Milo's excellent video on [Bookmarks](https://youtu.be/mcrcRXp5d8A)