How to Show Recently Edited Notes with Obsidian Dataview
In the world of digital note-taking, Obsidian has emerged as a powerful tool for organizing and managing information. One of its standout features is the Dataview plugin, which allows users to create custom queries and views of their notes. If you’re looking to display a list of recently edited notes in Obsidian, the Dataview plugin can help you achieve this with ease. In this article, we’ll guide you through the process of setting up a Dataview query to show recently edited notes.
First and foremost, ensure that you have the Dataview plugin installed in your Obsidian workspace. If you haven’t installed it yet, you can do so by navigating to the “Community Plugins” section in the Obsidian settings and searching for “Dataview.”
Once the plugin is installed, follow these steps to create a Dataview query that displays recently edited notes:
1. Open a new note or an existing one where you want to display the list of recently edited notes.
2. Type the following formula in the note’s editor:
“`dataview
TABLE WITHOUT ID FROM “note” WHERE created > now() – 7 DAYS ORDER BY created DESC
“`
This formula creates a table of notes from the “note” vault, filtering out notes created more than 7 days ago. You can adjust the time frame by changing the “7 DAYS” value to a different number of days.
3. Save the note and refresh the preview. You should now see a table of recently edited notes in your note editor.
To further customize the appearance of the table, you can modify the formula to include additional columns or sorting options. For example, to add a column for the note’s tags, you can modify the formula as follows:
“`dataview
TABLE WITHOUT ID FROM “note” WHERE created > now() – 7 DAYS ORDER BY created DESC | COLUMN tags
“`
This will add a column to the table that displays the tags associated with each note.
In addition to the formula, you can also use CSS to style the table. To do this, create a new CSS file in your Obsidian workspace and add the following code:
“`css
.dataview-table {
width: 100%;
border-collapse: collapse;
}
.dataview-table th, .dataview-table td {
border: 1px solid ddd;
padding: 8px;
text-align: left;
}
.dataview-table th {
background-color: f2f2f2;
}
“`
Save the CSS file and add the following line to the bottom of your Dataview formula:
“`dataview
| render(‘css’, ‘path/to/your/css/file.css’)
“`
Replace “path/to/your/css/file.css” with the actual path to your CSS file.
By following these steps, you can easily create a Dataview query to show recently edited notes in Obsidian. This feature can be particularly useful for keeping track of your work and staying organized in your digital note-taking journey.