Hello,
i have a query which gives me my Tasks for today.
But sometimes when i add Tasks in the following form, i don’t really have the context of the task.
Example in a journal page:
-#meeting #clientX
- TODO something to do
- TODO another thing to do
this results in something like this in my list:
- TODO something to do
- TODO another thing to do
but i would like the context, like this:
- TODO #meeting #clientX something to do
- TODO #meeting #clientX another thing to do
or alternatively if possible just include the parent block in the results, so that the context doesn’t get lost.
Any ideas how i can archive any of this?
my current query:
#+BEGIN_QUERY
{:title [:h3 "🗓️ Todays Tasks (excl. journal)"]
:query [:find ?d (pull ?h [*])
:keys date block
:in $ ?jdate
:where
[?h :block/marker ?m]
[(contains? #{"LATER" "TODO" "DOING" "NOW"} ?m)]
(or-join [?h ?d]
[?h :block/scheduled ?d]
[?h :block/deadline ?d])
[(= ?d ?jdate)]]
:result-transform (fn [result]
(for [row (sort-by :date result)]
(let [block-map (get row :block)
marker (:block/marker block-map)
deadline (:block/deadline block-map)
scheduled (:block/scheduled block-map)
current-properties (:block/properties block-map)
updated-properties (assoc current-properties :date (:date row) :marker marker :scheduled scheduled :deadline deadline)]
(assoc block-map
:block/properties updated-properties))))
:inputs [:today]
:breadcrumb-show? false
:collapsed? false}
#+END_QUERY