Query: incomplete tasks on all notes mentioning [[Person-A]]

Things I have tried

What I’m trying to do

Like many of you, I have a “Person” note for everyone I meet with regularly. I use the excellent Tasks plugin.

I’d like to have a query for all incomplete tasks on notes that mention [[Person-A]].
This would be useful for finding tasks that I owe the person, so I can prepare for our 1-on-1 meetings.

This can be done with dataview plugin (but I’m not sure if you want a solution only to Tasks plugin…)

Grant, I’ve used dataview plugin precisely for preparing for my 1-on-1’s. Below is another contributors response to my very same ask in a different thread for finding all tasks related to a particular project that I have also modified to find tasks related to a particular person.

1 Like

Topic

Summary
  • Q1: How to write a DQL for all uncompleted tasks on all notes that mention [[Tom]] via Dataview plugin? (DQL10)
  • Q2: How to write a DQL for all uncompleted tasks on all notes that mention [[Tom]] via Tasks plugin? (DQL20)
  • Q3: How to write a DQL for all uncompleted tasks on the current note that mention [[Tom]] via Tasks plugin within a DataviewJS code block? (DVJS10)
  • Q4: How to have a query for all uncompleted tasks on all notes that mention [[Person-A]] via Tasks plugin?(Conclusion)

Test

Summary
  • dataview: v0.5.46
  • tasks: v1.20.0 (For the DQL20 and DVJS10)

Input

Summary

the current note

```md
### DVJS10

### other tasks
- [ ] Do stuff for [[Tom]]
- [ ] Do stuff for [[Jack]]
- [X] Do stuff for [[Mary]]

```

dictionary files

  • Location: “100Project/02_dataview/Q76_tasks/Q76_test_data”

folder: 03

  • filename : dic_19710301
```yaml
---
Date: 1971-03-01
---

### some tasks
- [ ] Do stuff for [[Tom]]
- [ ] Do stuff for [[Jack]]
- [X] Do stuff for [[Mary]]

```

DQL10_use_fTasks_and_display_uncompleted_tasks_including_a_link

Summary

Main DQL

Code Name Data type Group By Purposes Remark
DQL10
_use_fTasks
_and_display
_uncompleted_tasks
_including_a_link
flattened file.tasks yes 1.To filter by uncompleted task
2.To filter by text where there is a link
3.To group by header
4.To display the result as a taskList [with the desired structure]

Code DQL10_use_fTasks_and_display_uncompleted_tasks_including_a_link

Summary_code
title: DQL10_use_fTasks_and_display_uncompleted_tasks_including_a_link =>1.To filter by uncompleted task 2.To filter by text where there is a link 3.To group by header 4.To display the result as a taskList [with the desired structure]
collapse: close
icon: 
color: 
```dataview
TASK
FROM "100_Project/02_dataview/Q76_tasks/Q76_test_data"

WHERE !completed
WHERE contains(text,"[[Tom]]")

GROUP BY header
```

Screenshots(DQL10)


DQL20_use_Tasks_and_display_uncompleted_tasks_including_a_link

Summary

Main DQL

Code Name Data type Group By Purposes Remark
DQL20
_use_Tasks
_and_display_uncompleted_tasks
_including_a_link
flattened file.tasks yes 1.To filter by uncompleted task
2.To filter by text where there is a link
3.To group by header
4.To display the result as a taskList [with the desired structure]
To require the tasks plugin

Code DQL20_use_Tasks_and_display_uncompleted_tasks_including_a_link

Summary_code
title: DQL20_use_Tasks_and_display_uncompleted_tasks_including_a_link =>1.To filter by uncompleted task 2.To filter by text where there is a link 3.To group by header 4.To display the result as a taskList [with the desired structure]
collapse: close
icon: 
color: 
```tasks
not done

path includes 100_Project/02_dataview/Q76_tasks/Q76_test_data
description includes [[Tom]]

group by heading

hide edit button
hide backlink
hide task count
```

Screenshots(DQL20)


DVJS10_use_Tasks_in_DVJS_and_display_uncompleted_tasks_including_a_link

Summary

Main DVJS

Code Name Data type Group By Purposes Remark
DVJS10
_use_Tasks
_in_DVJS
_and
_display_uncompleted_tasks
_including_a_link
flattened file.tasks yes 1.To filter by uncompleted task
2.To filter by text where there is a link
3.To group by header
4.To display the result as a taskList [with the desired structure]
To require the tasks plugin

Code DVJS10_use_Tasks_in_DVJS_and_display_uncompleted_tasks_including_a_link

Summary_code
title: DVJS10_use_Tasks_in_DVJS_and_display_uncompleted_tasks_including_a_link =>0.To require the tasks plugin 1.To filter by uncompleted task 2.To filter by text where there is a link 3.To group by header 4.To display the result as a taskList [with the desired structure]
collapse: close
icon: 
color: 
```dataviewjs
// M11.define query: require the tasks plugin
// #####################################################################
const query = `
not done

path includes ${dv.current().file.path}
description includes [[Tom]]

group by heading

hide edit button
hide backlink
hide task count
`;


// M51.output query:
// #####################################################################
dv.paragraph('```tasks\n' + query + '\n```');


```

Screenshots(DVJS10)


Conclusion

Summary

Q4: How to have a query for all uncompleted tasks on all notes that mention [[Person-A]] via Tasks plugin?

A4:

Another Example: A4_41
```tasks
not done
description includes [[Person-A]]
```

Reference

Summary

Thanks very much for the responses! This is very helpful.

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