Collecting All Tasks within a Specific Folder

What I’m trying to do

I am trying to collect all the tasks within a particular folder in one spot. The tasks are distributed among several files within the particular folder.

Things I have tried

I’ve found folks attempting similar tasks, but not exactly what I want to do. Here’s the current dataview code that I’m working with after stringing together multiple sources

```dataview
TASK
FROM "Path to Folder"
WHERE file.task
GROUP BY file.name

Unfortunately that doesn’t return any of the tasks I’ve created in the files within the folder.

Using Dataview isn’t a requirement. Whatever works, I will use. Any help would be much appreciated!

1 Like

You’re super close! I think to do exactly what you ask, all you need are these two lines:

```dataview
TASK
FROM "path/to/folder"

That should return all tasks within a folder in the order that they appear.

If you add GROUP BY file.name then you get file headers, which is nice. And you can also filter out completed tasks (if you want) with WHERE !completed.

2 Likes

Thank you for the help! Unfortunately, I’m still getting no results. I’m not sure what’s afoot. My plugins are up-to-date, and I definitely have tasks in the files within the folder.

Here’s my current code

```dataview
TASK
FROM "Full File Path to Folder"
GROUP BY file.name

Here’s a sample of my Tasks.

The results are “Dataview: No Results to show for task query.”

Full file path? You only need the folder part from within your vault

I figured out the issue! I have this particular folder within a nestled folder. Additionally, the full folder path as copied from File Explorer doesn’t work. Instead it has to be formatted as such, which you indicated in your original post, but I’m just now realizing the error on my part.

The CORRECT format:

TASK
FROM "Top Folder/Target Folder"
GROUP BY file.name

The INCORRECT Format

TASK
FROM "Top Folder\Target Folder"
GROUP BY file.name

Also INCORRECT

TASK
FROM "C:\Users\my name\Documents\Obsidian Vault\Top Level\Target"
GROUP BY file.name
2 Likes

Yeah file paths can be a bit tricky. Glad you figured it out!

1 Like

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