List all files in a folder Alphabetically using Dataview?

What I’m trying to do

I am using a Dataview query to list all the files in a folder. It returns two columns.
I found the code somewhere in this forum, but I didn’t record the link.

This is the code I use:

TABLE WITHOUT id file.link AS "File Name", Content AS "Description"
FROM "CODE SNIPPETS"
WHERE file.link sort asc

and it returns this (which is what I want)

I would like to have the results list the files in Alphabetical order and I have no idea how to do this.

Any advice will be appreciated.

Thanks

Your query has a syntax issue in the WHERE and sort clauses. To sort alphabetically by the file link, use SORT instead of WHERE. Here’s the corrected version:

TABLE WITHOUT ID file.link AS "File Name", Content AS "Description"
FROM "CODE SNIPPETS"
SORT file.link ASC

More you can get at Structure of a Query - Dataview

Cheers, Marko :nerd_face:

Thank You Marko :+1:

That worked a treat !

1 Like