close
close
how to show recently edited notes obsidian dataview

how to show recently edited notes obsidian dataview

2 min read 18-01-2025
how to show recently edited notes obsidian dataview

Obsidian's power lies in its flexibility and interconnectedness. But finding your recently edited notes amidst a growing vault can be tricky. This article shows you how to leverage Dataview to quickly locate and access your most recently updated notes. This is especially helpful for keeping track of your current projects and active thinking.

Understanding the file.cday and file.mtime Properties

Dataview uses several built-in properties to extract information from your files. Two crucial properties for this task are:

  • file.cday: This property represents the creation date of a note.
  • file.mtime: This represents the last modification time of a note. This is what we'll focus on to find recently edited notes.

Querying Recently Edited Notes with Dataview

The core of our solution involves a simple Dataview query that filters notes based on their file.mtime. Here's how you can do it:

LIST
WHERE file.mtime > date("$(date('now', '-7 days'))")
SORT file.mtime desc

Let's break this query down:

  • LIST: This tells Dataview to present the results as a list.
  • WHERE file.mtime > date("$(date('now', '-7 days'))"): This is the crucial part. It filters notes where the last modification time (file.mtime) is after seven days ago. You can adjust '-7 days' to change the timeframe (e.g., '-1 day' for notes edited in the last 24 hours, '-1 month' for the last month). The date() function ensures correct date formatting.
  • SORT file.mtime desc: This sorts the results in descending order based on modification time, showing the most recently edited notes first.

Customizing Your Dataview Query

This basic query can be extended for more sophisticated results. Here are a few examples:

1. Showing only the filenames:

LIST
WHERE file.mtime > date("$(date('now', '-1 week'))")
SORT file.mtime desc

2. Displaying more information (e.g., file path and modification time):

TABLE file.name, file.path, file.mtime 
WHERE file.mtime > date("$(date('now', '-1 day'))")
SORT file.mtime desc

3. Filtering by folder:

Let's say you only want to see recently edited notes within a specific folder called "Projects":

LIST
WHERE file.folder = "Projects" AND file.mtime > date("$(date('now', '-1 week'))")
SORT file.mtime desc

Adding this to a Daily Note Template

For seamless integration, consider adding this query to your daily notes template. This allows you to quickly review what you worked on recently each day.

  • Open your daily note template file (usually Daily Note Template.md).
  • Insert the Dataview query within the template, adjusting the timeframe as needed.

Troubleshooting and Tips

  • Ensure Dataview is properly installed and configured: Check your Obsidian community plugins settings.
  • Experiment with different timeframes: Adjust the number of days in the date('now', '-X days') part to fit your needs.
  • Consider adding other filters: You can combine the file.mtime filter with other criteria (e.g., tags, folders) to further refine your results.

By using these Dataview queries, you can efficiently locate your recently edited Obsidian notes, enhancing your workflow and productivity. Remember to adapt these examples to match your specific needs and folder structure. This helps you stay organized and focused on your active projects within your ever-growing Obsidian vault.

Related Posts