Dataview list of 25 most recently modified files in vault

What I’ve Tried

TABLE file.mtime AS "Last Modified"
FROM ""
SORT file.mtime DESC

What I’m trying to do

I’m trying to workaround the a gap in Obsidian. The “Recent Files List” plugin does not sync the list between devices. So each device has a different list of recently modified files. I strongly suspect that Dataview could be used to create a page of recently modified files in a vault.

I’m seeking suggestions for Dataview code that can show a table of file names and modification times sorted with most recently modified files at the top. The list should be limited to the most recent 25 files and should include files from all folders in the vault.

1 Like

Try this:

```dataview
TABLE dateformat(file.mtime, "dd.MM.yyyy - HH:mm") AS "Last modified"
FROM ""
SORT file.mtime DESC
LIMIT 25
```
15 Likes

Works great! (even on mobile)

A couple of other options:

List of X Recent Notes

```dataview
LIST 
WHERE date(today) - file.mtime
WHERE file.name != this.file.name
SORT file.mtime DESC
LIMIT 25
```

List of Notes in Last Day or X Days (limit can be added optionally)

```dataview
LIST 
WHERE date(today) - file.mtime <= dur(3 days)
WHERE file.name != this.file.name
SORT file.mtime DESC
```

Angel

10 Likes

That’s great team work! Thank you for the help.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.