Advanced query for a list of blocks in the journal, of a given project (property value)

I am trying (without success) to come up with a query that provides a list to project meetings, for a given project.

For every meeting in my journal, I use this in the first block:

**Meeting / Project**
tags:: meeting, project
subject:: Low level design discussion
project:: Moon Rocket

What I need is a query that gives a list with links to all the relevant Journal blocks for a specific project, e.g. :project == “Moon Rocket”

I tried to adapt queries I found in the forum but I couldn’t find any that actually works and fits my use case. Any guidance on this would be great.

  • Let’s begin with a query that returns the blocks of a project:
    #+BEGIN_QUERY
    {
     :query [:find (pull ?b [*])
       :in $ ?title
       :where
         [?b :block/properties ?props]
         [(get ?props :project) ?project]
         [(= ?project ?title)]
       ]
     :inputs ["Moon Rocket"]
    }
    #+END_QUERY
    
  • Concerning the looks, try providing an example of the desired output.

@mentaloid thanks!!! getting close!
The query is returning non-meeting blocks as well, is there a way to only return blocks that also have the “meeting” tag - notice the tag I use in my journal for project meetings:
tags:: meeting, project

Last but not least, instead of the blocks themselves, can the query output be a table with the link to the meeting notes? ideally with a column that contains the journal page date

  • For meeting-filtering, try adding these lines:
         [(get ?props :tags) ?tags]
         [(contains? ?tags "meeting")]
    
  • Concerning the table, have you tried switching to table view (from the top-right button) and clicking on a row?
2 Likes

Thank you once again!! perfect.
Including the table view! I thought a line was needed in the query to get the table-view to activate. Awesome, thanks again