Find all tasks under blocks tagged with project namespaces?

Check out this post:

(Sorry doing this from a hospital bed on my phone :rofl: but thought I could at least point you in the right direction)

Omg, you’re my savior - this works perfectly. For whatever reason you’re in the hospital - I hope you get well soon! :blush::blush:

1 Like

Thanks. Had emergency surgery, but I’m back home and recovering just fine.

This thread is so helpful! I would like to sort the output by project - right now it is sorted by date of journal entry.

I tried adding:

:result-transform (fn [result]
                                 (sort-by (fn [h]
                                                  (get h :block/name)) result))

With no change

It outputs blocks, not pages. So we need to first get the page.
(get h :block/name)
Needs to be (get-in h [:block/page :block/name])

1 Like

@Siferiax can you please add that sort criteria into the original query and republish? something im not understanding - thank you!

Which query do you mean exactly? There is a bunch of queries posted in this thread and I’m not sure which you refer to.

1 Like

I feel that these queries are almost what I need.
I am having trouble finding a query that will work for the following workflow:

  1. I use the journal in Logseq to log actions and todos for the day. As a simple example for the journal page for the last two days:
[[2025-05-01]]
     - stuff occurred two
     - stuff occurred three
     [[project/PlanParty]]
          - worked on tables 
          TODO email Bob
     [[project/Cookout]]
          - worked on grill
          TODO pick up meat

[[2025-04-30]]
     - stuff occurred one
     - stuff occurred two
     [[project/PlanParty]]
          - worked on tables
          TODO call Gregg
     [[project/Cookout]]
          - cleaned area
          TODO cut grass
  1. Now, I would like to build a query that will produce the following results:
Todos for All Namespace Projects:
[[project/PlanParty]]
     TODO call Gregg
     TODO email Bob

[[project/Cookout]]
     TODO pick up meat
     TODO cut grass

Any help would be most appreciated.
@Siferiax

If you are trying to group by project, try the approach in A list of next tasks grouped by projects