Dataview (or other) query for all items in page "section"

Things I have tried

I haven’t found a way to approach this yet.

What I’m trying to do

I would like to list all (list) items within a particular “section” of a set of pages.

I have many pages each containing somewhere in them a named “Book List” section:

##  Book List

- aaa
- bbb
- ccc

Can Dataview (or something else?) return all of those items from across all the pages?

Dataview have a new feature to work with lists. But to try it you need to install the beta version (via BRAT plugin - obsidian://show-plugin?id=obsidian42-brat)

I’m using BRAT, but is there a different source for Dataview than this: GitHub - blacksmithgu/obsidian-dataview: A high-performance data index and query language over Markdown files, for https://obsidian.md/. ? The only list function I can find there is to list pages. Or where should I be looking? Sorry for missing it!

Did you install dataview with BRAT? If yes, you have the version 0.5.16 (Beta), if not you have the version 0.4.26.
The new metadata structure in beta versions isn’t yet documented.
But if you use the inline js query to check the metadata in one sample note, you see a new lists level:

`$=dv.span(dv.current())`

If in table query, this level is target with file.lists.
I have not yet check how to explore this new resource, but I think that is similar to the tasks.
For test purposes, try something like:

TABLE L.text
FROM "your-folder-path"
FLATTEN file.lists as L
WHERE !L.status
WHERE meta(L.section).subpath = "Book List"

(there’s necessary to separate lists from tasks… I tried the status data, but I’m not sure about it)

5 Likes

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