Help with query for book listings

What I’m trying to do

I’m new to Obsidian and I’m trying to build a table that will show me books that are tagged for a certain category

Things I have tried

My list looks as follows:

  • title: [[The Wealth of Nations]]
    author: Adam Smith
    tags: [economy_book]

  • title: [[Book2]]
    author: John
    tags: [economy_book]

  • title: [[Book3]]
    author: Doe
    tags: [psychology_book]

  • etc…

I then try to create the table using this in dataview markdown:

table
from [[Books]]
where contains(tags, “economy_book”)

I am not getting any results and was wondering why.

Thanks for your help!

I’m assuming each book is a note:

```dataview 
TABLE
WHERE contains(file.tags, "economy_book")```

Is that list of books written in the frontmatter/property section, or within the body of the note? If in the properties then what is the containing property of the list? If in the body, an inline field needs to use double colons.

Lastly the usage of tags in your case might cause some issues depending on where your text is written.

That worked for me, thanks! I was able to understand how to tweak it for my needs.

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