Hi,
I’m trying to fetch all the past TODOs under my journal pages. But I’m having a problem getting tags that are nested like this
[2022/03/28]
TODO Something 1
TODO Something 2
Using this query I’m able to find all TODOs on all my pages, included the ones nestes as above
#+BEGIN_QUERY
{:title "Find: tagged tasks"
:query [:find (pull ?b [* {:block/_parent ...}])
:where
[?b :block/marker ?marker]
[(contains? #{"TODO" "LATER" "NOW"} ?marker)]
[?b :block/ref-pages ?p]
[?p :block/name ?tag]
]
}
#+END_QUERY
And by using this Query I am able to get all todos under my journal page. However, not the once that are nested as above.
#+BEGIN_QUERY
{:title "🗄️ Forgotten"
:query [:find (pull ?h [*])
:in $ ?start ?next
:where
[?h :block/marker ?marker]
[?h :block/page ?p]
[?p :page/journal? true]
[?p :page/journal-day ?d]
[(> ?d ?start)]
[(< ?d ?next)]
[(contains? #{"NOW" "DOING" "LATER" "TODO"} ?marker)]]
:inputs [:365d :14d]
:result-transform (fn [result]
(sort-by (fn [h]
(get h :block/priority "Z")) result))
:collapsed? true}
#+END_QUERY
Is there anyway I can modify either of these to find all my todos on the journal pages?
Thanks in advance!