Skip to content

Is it possible to just list all sub-folder name in a folder? #2219

Answered by holroy
francisHugo asked this question in Q&A
Discussion options

You must be logged in to vote

What kind of a sub-folder name do you want to list? The path & folder of the current note is availabe in file.path and file.folder, and you could manipulate these using stuff like split().

If you want to list all existing sub-folders of a given folder, it can kind of be done if there are files in those folders. Then you could do a query to list all notes in the current folder and sub-folders, and then strip out the sub-folder part of your text and use that to group your entries by those sub-folders. Does that make sense?

The following query shows 10 of the sub-folders to the ForumStuff folder in my test vault:

```dataview
LIST
FROM "ForumStuff"
FLATTEN list(split(file.folder, "/")) as fol…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by francisHugo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants