These are some super useful data view snippets I use in my Obsidian note.
Index of All Notes ( Listed as Table )
TABLE link(sort(rows.file.name)) AS Files
FROM "" WHERE file.folder
FLATTEN file.folder AS Folder
GROUP BY Folder
SORT Folder Asc
Index of All Tags ( Listed as Table )
TABLE WITHOUT ID (tag + "(" + length(rows.file.link) + ")")
AS Tags, link(sort(rows.file.name))
AS Files
FROM ""
WHERE file.tags
FLATTEN file.tags
AS tag
GROUP BY tag
SORT file.name Asc
List All Recently Modified Files
LIST FROM ""
WHERE file.name != this.file.name
SORT file.mtime DESC LIMIT 15
I also use a plugin call Zoottelkeeper which creates an auto-updating index file inside all the folders.
In the “Zoottelkeeper plugin settings” I have prefixed all index files with " ".
So, I have added an additional line to omit the auto-updated index files from showing up in the recent file.
WHERE !contains(file.name, "🏷")
edit: added date also
LIST
" | <small>*Modified: "+file.mtime+"*</small>
| <small>Created: "+file.ctime+"</small>"
FROM ""
WHERE file.name != this.file.name
WHERE !contains(file.name, "🏷")
SORT file.mtime DESC LIMIT 15
This are the most useful Dataview Snippets examples I’ve come across. Even better to understand than the ones given on the documentation/page of the plugin.
Thank you for sharing them since they helped me understand a little bit better about how to group.
@maddyboy, thank you for sharing these, this is the first time I think I understand the use of FLATTEN! Just to check my understanding, am I correct that FLATTEN <expr> is always followed by AS because it creates a new (computed) column that doesn’t otherwise have a name? Thanks!