The actual status.type
is something only available within a tasks query. However, you can decipher what they are by looking in Settings > Tasks (Task Statuses). Here you’ll see the Core Statuses and potentially any Custom Statuses. An example of a setup is shown below:
So the answer to you question is both yes and no. No, you can’t check for status.type = TODO
or similar, but you can check what the status
of a given task is using dataview.
Given the setup above, we can see the following groups of statuses:
- TODO:
, /
- IN_PROGRESS:
/
- CANCELLED:
-
- DONE:
x
To check for the last three you could simply do t.status = "x"
or similar. For the groups, you need to do it slightly different. Lets give some examples:
### DQL - task
```dataview
TASK
WHERE file.name = this.file.name
WHERE contains(list(" ", "/"), status)
```
### DQL - table
```dataview
TABLE WITHOUT ID T.text, T.type, T.status
FLATTEN file.tasks as T
WHERE file.name = this.file.name
WHERE contains(list(" ", "/"), T.status)
```
### Dataviewjs variant
```dataviewjs
const tasks = dv.current()
.file.tasks
.where(t => [' ', '/'].includes(t.status))
dv.taskList(tasks)
```
All these three variant will pull tasks from the current file, having a status of either
or /
. If you feel like it, you could of course extend these lists further and include other statuses. For example some like to include the BuJo markers <
& >
into the TODO list. And depending on personal preferences the -
, aka cancelled, could be considered both DONE and NOT DONE…
Suggestion on using literals in dataview
The literals used by tasks are not readily available within dataview, and the bare lists could possibly not look as good, so here are two alternatives to define these lists:
## Within dataviewjs
```dataviewjs
const TODO = [' ', '/', '<', '>']
const DONE = ['x', '-']
const tasks = dv.current()
.file.tasks
.where(t => TODO.includes(t.status))
dv.taskList(tasks)
```
## Within dataview
```dataview
TASK
FLATTEN list(" ", "/", "<", ">") as TODO
WHERE file.name = this.file.name
WHERE contains(TODO, status)
```
and if you wanted to check for DONE, you could exchange the query to
```dataview
TASK
FLATTEN list(" ", "/", "<", ">") as DONE
WHERE file.name = this.file.name
WHERE contains(DONE, status)
```
In summary, the groups defined by tasks can’t be used directly within dataview queries, as far as I know, but they’re defined by the content of the status
field, and this field you can check from both DQL and dataviewjs queries.
PS! In all of my queries I use variant of dv.current()
or WHERE file.name = this.file.name
to limit the query to the current test file. You will of course need to change this to match your base task lists.