Dataview - List all canvas files in specific folder

Hi Fellow Obsidian Friends,

Nothing really special, just a snippet that might help other folks working on their own custom folder structures, project homepages, and Dataview queries.

I found a similar topic (list all canvas files), but what I needed was specifically listing all canvas files from a specific folder.

It took me an hour to make Dataview’s dataviewjs query type do what I asked:

const moodFolderFiles = app.vault.getFiles()
	.filter( (file) => { 
		return ( 
			file.path.includes('MOODBOARDS') &&
	.map( (file) => {
		const matches =[^/]+)\.canvas$/)
		return dv.fileLink(, false, (matches ? matches[1] :

dv.list(dv.array(moodFolderFiles).sort(l => l.display, 'desc'));

If you have some ideas, suggestions on improving the snippet, I welcome all shares.


Thank you. Bewen bugging me for a while. Worked a treat.

1 Like

const canvas = (app.vault.getFiles().filter(file => file.extension === 'canvas')).sort((a, b) =>;;
dv.list( => dv.fileLink(file.path)))

here’s an alternative