Issue filtering flashcards by page property

Hello Logseq experts,

I’m having an issue trying to filter flashcards using the page property in my Logseq graph. This issue is important to me because it impacts my study sessions.

In my graph, I use a page property called :subject to categorize and filter all pages related to a specific topic. When I use the query {{query (page-property :subject)}}, I correctly get all the listed pages, i.e., the ones that are actually related to the topic.

However, when trying to filter the flashcards using the following syntax {{cards (page-property :subject)}} (just replacing the word query with cards), the flashcards I receive as a result are all the flashcards in my graph, and not only the ones related to the topic, as I expected.

This is an issue because it means I end up having to review flashcards for subjects I don’t want to focus on during that study session.

I’d like to know if this is expected behavior or if there’s a configuration I can adjust to filter the flashcards according to the page property, so that I only get the flashcards related to the subject I’m currently studying.

I appreciate any help or guidance you can provide.

Welcome.

  • Some queries return blocks, some return pages.
  • Macro {{cards ...}} looks for blocks. It doesn’t work with queries for pages.
  • I’m not aware of an easy way to achieve what you want.
  • Inspired by Find all Cards linked to a Topic, here are the general steps of a non-easy way:
    • make an advanced query that returns the names of the relevant pages inside double square brackets
    • copy the result and further process it as needed
    • use macro {{cards (or ...) }}
    • paste the processed result where the ellipsis-dots are
2 Likes

Now it makes sense why it doesn’t work. Because cards returns blocks and not pages. Thank you for the clarification. I will try another solution to that. :face_with_diagonal_mouth:

The solution provided in this other post sadly doesn’t fit to my use case. Because there are many pages in my graph related to subject and the query would be always changing. Thanks anyway.