Using Dataview to display all list sub-item text under a #tag parent item

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

User story:

I am a developer and use Daily Notes to summarize knowledge in lists, organized by tags.

I am trying to build a unique “View” note for each tag that lists all list sub-items of the parent tag in question.

The intent is to summarize all information associated with a certain tag in one place regardless of where it is noted.

e.g.:

[[dailyNote file]]

dev

  • #dev/nuget #dev/techdebt #dev/
    • nuget is really cool
    • i like nuget

I then have a separate “Views” folder containing a note for each tag, e.g. views\dev\nuget that contains a Dataview query to return all sub-list text where #dev/nuget is the parent item.

Things I have tried

I’m running into issues getting Dataview to appropriately only display list child items of a tag parent item. The closest I’ve gotten used this as guidance: Dataview related guidance requested for Key Takeaways - Help - Obsidian Forum

TABLE Lists.text As “Content”
FROM “dailyNotes OR sourceMaterial AND #dev/nuget”
WHERE file.lists
FLATTEN file.lists AS Lists
WHERE meta(Lists.section).subpath = “dev”

However this just lists every item in a list that contains “#dev/nuget.”

Updating the last line to:
WHERE meta(Lists.section).subpath = “dev” AND List.parent = “dev/nuget” //or “#dev/nuget”

Returns no results.

I am seemingly failing on how Dataview recognizes the “.parent” property on “List.”

I’ve also thought to use an inline property to wrap the entirety of the desired content, but the meta(Lists.section).subpath method seems more suitable.

Any thoughts? Thanks!

I’m not sure what you want is actually possible, since the only reference a given item has to its parent is the line number of the parent item. Not the text (or metadata) of the parent item.

You could part of the way through switching your focus to looking at the parent item itself and displaying its children. This however doesn’t easily extend multiple levels below the initial level.

Example note and queries

Copy the following to a note, and execute the queries:

**dev**

- #dev/nuget #dev/techdebt #dev/ 1
    - nuget is really cool 1.1
    - i like nuget 1.2
- - #dev/nuget #dev/techdebt #dev/ 2
    - nuget is really cool 2.1
        - unreal 2.1.1
    - i like nuget even more 2.2
- - #dev/nuggets #dev/techdebt #dev/ 3
    - chicken nuggets? 3.1

## The children

```dataview
LIST item.children.text
FROM #dev/nuget 
FLATTEN file.lists as item
WHERE contains(item.tags, "#dev/nuget")
```


## Just the texts
```dataview
LIST WITHOUT ID childText
FROM #dev/nuget 
FLATTEN file.lists as item
WHERE contains(item.tags, "#dev/nuget")
FLATTEN item.children.text as childText
```

In my test vault with no other #dev/nuget lists, it displays the following:

Notice how it fails to show the unreal 2.1.1 item. The numbers are added for referencing into the example note.


Theoretically you could start scanning the entire file, and possible expand multiple levels down, but it gets hairy very fast…