HSAI
1
Hi everyone,
Here’s an example of what I’m working with:

Is there a way I can use advanced queries to return all tasks with “NOW” status alongside the value of the “group” property from their parent blocks?
I’ve tried a number of ways and not getting anywhere
Thank you !
Not sure of the exact result you are after, but this will at least display the information for you.
#+BEGIN_QUERY
{:query [:find ?group ?id ?task
:keys group id task
:where
[?b :block/marker "NOW"]
[?b :block/content ?task]
[?b :block/uuid ?id]
[?b :block/parent ?pb]
[?pb :block/properties ?prop]
[(get ?prop :group) ?group]
]
:view (fn [rows] [:table [:thead [:tr [:th "Group"] [:th "Task"] ] ]
[:tbody (for [r rows
:let [content (str (get-in r [:task]))]
:let [firstline (first (str/split-lines content))]
:let [displayline (str/replace firstline "NOW" "")]
] [:tr
[:td (get-in r [:group]) ]
[:td [:a {:href (str "#/page/" (get-in r [:id]))} displayline] ]
])]
])
}
#+END_QUERY
