Sort by multiple columns

Thanks a lot, it was indeed the fix ! I did not think about it at all, even though it was stated here.

Here is the corrected script with multiple sort orders :

#+BEGIN_QUERY
{:title [:h3 "🔨 Now"]
:query [:find (pull ?b [*])
  :where
    [?b :block/marker ?marker]
    [(contains? #{"DOING" "NOW"} ?marker)]  ; Check if the marker is either "DOING" or "NOW"
]
:table-view? false
:breadcrumb-show? false  ; Don't show the parent blocks in the result
:result-transform (fn [result]
  (sort-by
    (fn [r]
      [
        (get-in r [:block/deadline] 99991231)
        (get-in r [:block/scheduled] 99991231)
        (get-in r [:block/priority] "Z")
      ]
    ) result)) ; Sort the result by the deadline date, then scheduled date and then by priority
}
#+END_QUERY