Trying to filter with dataview prioritised to-do's

I’m looking for a way to get all the prioritised checks from every checklist, right now I’m trying this using tags and dataview. Unfortunately with my method I’m showing all the checks within that document where the tag #priority can be found instead of just that check where the tag is near.

My example:

### Checklist
- [ ] Check 1
- [ ] Check 2
- [ ] Check 3 #priority

dataview query:

TASK from -"Templates" & #priority

Result:
See screenshot
unknown

Hi.

The problem is: tags are a page level metadata, not a specific task metadata.

The result is correct, because you are asking for tasks in pages(notes/files) with the tag #priority.

If you want a specific filter for your tasks you have two ways (at least…):

  1. You can use your tags but you need to filter them as a content inside the text of the tasks (because the content of the task is an implicit field). Something like: "tasks where the task text contains '#priority`):
```dataview
TASK
FROM -"Templates"
WHERE contains(text, "#priority")
```
  1. If you don’t want to use tags, you can create an inline field (inline fields in tasks working only at task level)…
### Checklist
- [ ] Check 1
- [ ] Check 2
- [ ] Check 3 (priority:: high)

---

```dataview
TASK
WHERE priority = "high"
```

2 Likes

Thank you so much! This solved it and I understood why :slight_smile:

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