Find linked notes in tasks

What I’m trying to do

I use internal links to categorize my tasks. I would like to (1) get a list of notes linked in tasks and (2) organize tasks by linked (and unlinked aka orphaned) notes.

Here’s a list of tasks:

  • [ ] TODO take out garbage [[home]]
  • [ ] TODO organize [[work]] emails at [[home]]
  • [ ] TODO make presentation [[work]]
  • [ ] TODO buy pasta

Part 1: Get a list of notes linked in tasks

  • [[work]]
  • [[home]]

Part 2: Organize tasks by linked (and unlinked) notes

[[work]]

  • [ ] TODO organize [[work]] emails at [[home]]
  • [ ] TODO make presentation [[work]]

[[home]]

  • [ ] TODO take out garbage [[home]]
  • [ ] TODO organize [[work]] emails at [[home]]

unlinked

  • [ ] TODO buy pasta

What I’ve tried

I’ve tried using dataview and tasks.

I can get a list of all tasks with each:

dataview

TASK FROM #testingdates

dataviewjs

dv.taskList(dv.pages("#testingdates").file.tasks)

tasks

path includes test-dataview-list-1

I can limit to a specified link using tasks (not sure with dataview)…but I would have to manually repeat for all linked files:

tasks: home

path includes test-dataview-list-1
description includes [[home]]

Or for unlinked tasks…

tasks: unlinked

path includes test-dataview-list-1
description does not include [[

Screenshots

A strange way, but try this:

```dataview
TASK
FROM #testingdates
GROUP BY choice(contains(text, "[[work]]"), [[work]], choice(contains(text, "[[home]]"), [[home]], "unlinked")) AS HH
SORT HH ASC
```

EDIT: fails when two links in same task… :confused: because with group one task can’t be on two places at same time! In the query above task is grouped in the first link defined in the group by expression.

1 Like

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