Query to return NOW tasks and property from their paren't blocks

Hi everyone,

Here’s an example of what I’m working with:

Screenshot 2023-02-02 at 12.49.25

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.

{:query [:find ?group ?id ?task
 :keys group id task
   [?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] ]