How to create an advanced query to pull blocks from a specific page?

How to create an advanced query to pull blocks from a specific page?

For exemple: I want to pull ALL BLOCKS from PAGE TASK.

Thanks

Welcome. Try this:

#+BEGIN_QUERY
{:title [:b "All blocks from page task"]
  :query [:find (pull ?b [*])
  :where
    [?p :block/name "task"]
    [?b :block/page ?p]
  ]
}
#+END_QUERY

Mind that the name of the page should be in lower-case, otherwise should use :block/original-name instead.

1 Like

Thankss, it worked.

Can you help me filter this block by deadline and sorte by deadline?

Check Sort deadline query chronologically