Task query from specific folders

Hi!
I’m using Tasks plugin in my daily note to show the tasks that must be done today (by example).
I have also the Archiver plugin to archive the tasks done.
I wish to keep the tasks in the daily note but I didn’t find the correct code to insert in the query.
The archived tasks are in the z_archive folder, the daily tasks in family or work or inbox folder.
Can you help me, please?
The actual query is:

tasks
due today
sort by description

(of course surrounded by three bactick)
Thanks in advance for any help

I think you want your code to look like this, to collect all your tasks in one view:

```tasks
due today
sort by description
```

If you don’t have tasks on the top line next to your backticks, Obsidian doesn’t know that the code block is supposed to do something.

But I’m also not sure what the actual issue is you’re trying to fix. Is it that the code isn’t working at all, or that you want to have specific lists of tasks from specific folders? If you want to filter by folder, add a line that says path includes <folder name>:

```tasks
due today
path includes family
sort by description
```
1 Like

First of all thanks a lot for your help and sorry for reopening this request.
I’ve tried and it seemed to work.
Today I’ve tried with a different folder and it’s not working anymore:

```tasks
due today
path includes z_archive
sort by description

This is the folder where the task archiver plugin save the archived task (task with “done” status).
What can I do?

What sort of error are you getting from Dataview? Is it simply not showing anything at all or does it error out like it doesn’t know what path you’re talking about?

It simply doesn’t show anything at all, also if in z-archive/ToDo (archive).md there’s some done tasks

In your previous post you used z_archive, and now you’re using z-archive. Make sure you’re using the correct name in your query.

My fault (bad typing) the folder is z_archive and I’m using the right one in the query

And probably I’ve found the problem. Originated by me, of course I feel so stupid…

The Daily Note have a date in the format dd-MM-yyyy and the Tasks plugin use the format yyyy-MM-dd. Since I’ve recently changed the date format in the Daily Notes I’ve not set myu mind on this part, sorry
It would be possible to show the done task in some way?

Oh whoops, I had my mind in Dataview mode, not Tasks mode, sorry :sweat_smile:

Okay, so I’m getting your code to work for me to show all tasks in z_archive that were due today. If you want to show all tasks regardless of when they’re done, just take out the due today part. If you want to just show done tasks, just add a line in there that says done.

```tasks
due today
done
path includes z_archive
sort by description
```

If you want to start looking into more varied filter commands, check out the filter documentation.

Thanks a lot but is not working. I think is because of the different date format between note name and tasks data.
I’ll check your link and Tasks documentation to see what can be done for my case.

Probably I’ve found the solution.
You have to disable “Add some metadata to task before archiving” in the plugin’s settings.
With this and archive in the same file under an heading (“Archived” in my case) it seems to work

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