Hi all,
I’ve been wrestling with this one for a few days… Basically I want to create a query I can put in an “Agenda” page, that displays all my weekly tasks sorted by day of the week. Just like in org-agenda, but I’d be excited to switch to Logseq from Emacs!
Here’s what I have so far. I was planning to put headings “Monday”, “Tuesday”, etc. and put this query in each. Really hacky, but not sure how else to do it…?
I’ve gotten it to the point where it isn’t throwing errors anymore, but now it returns no results! Does anyone have an idea where I’ve gone wrong?
#+BEGIN_QUERY
{
:title "Sunday in next 7 days"
:query
[:find (pull ?block [*])
:in $ ?start ?end ?today
:where
[?block :block/marker "TODO"]
[?block :block/content ?content]
[(clojure.string/includes? ?content "Sun")]
[?block :block/scheduled ?scheduled]
[(>= ?scheduled ?today)]
[(<= ?scheduled ?end)
]]
:inputs [:today :7d-after ["Sun"]]
:result-transform (fn [result]
(sort-by (fn [d]
(get-in d [:block/scheduled :time]))
result))
:collapsed? false
:table-view? false
:group-by-page? false
:breadcrumb-show? false
}
#+END_QUERY
Bonus points if it can display tasks in order of time scheduled!
I’m aware of the agenda plugin, but am looking for a more distraction-free simple list of tasks. And I love the way queries’ output is directly editable.
Looks like others were looking for something similar in this forum, so hopefully we could be nearly there