Can I add a link in my queries to jump directly to the Task (which is located on another Page) ?
The closest I can think of is a query that produces a table with links in an extra column. For an example, check All page references in the current page
Perhaps I’m being dim but if you click the bullet it will open a focused view of the task.
Is that not the functionality you want?
You can even go from there to the parent block/page of the task as needed (although I appreciate that’s another step)
2 Likes
I tryed to add the :result-transform to my query, but my knowledge is too low.
That’s my query:
#CAUTION
#+BEGIN_QUERY
{:title [:h4 "Aufgaben des Tages" ]
:inputs [:query-page] ; lower-case name of the page the query is on
:query [:find (pull ?b [*])
:in $ ?page
:where
[?p :block/name ?page] ; this is always lower-case
[?p :block/journal-day ?day]
[?b :block/scheduled ?day]
[?b :block/marker ?m]
[(contains? #{"TODO" "LATER"} ?m)] ; can use whatever state you want here, just an example
]
:breadcrumb-show? true
:group-by-page? true
}
#+END_QUERY
And thats my try:
#CAUTION
#+BEGIN_QUERY
{:title [:h4 "Aufgaben des Tages" ]
:inputs [:query-page] ; lower-case name of the page the query is on
:query [:find (pull ?b [*])
:in $ ?page
:where
[?p :block/name ?page] ; this is always lower-case
[?p :block/journal-day ?day]
[?b :block/scheduled ?day]
[?b :block/marker ?m]
[(contains? #{"TODO" "LATER"} ?m)] ; can use whatever state you want here, just an example
]
:result-transform (fn [result]
(map (fn [r]
(update (:b r) :block/properties (fn [p]
(assoc p "reference" (:ref r) )
) )
) result)
)
:breadcrumb-show? true
:group-by-page? true
}
#+END_QUERY
And the result:
Do you have any Idea ?
- @Thorah is right.
- You may still try this:
#CAUTION #+BEGIN_QUERY {:title [:h4 "Aufgaben des Tages" ] :inputs [:query-page] ; lower-case name of the page the query is on :query [:find ?m (pull ?b [*]) :in $ ?page :keys state b :where [?p :block/name ?page] ; this is always lower-case [?p :block/journal-day ?day] [?b :block/scheduled ?day] [?b :block/marker ?m] [(contains? #{"TODO" "LATER"} ?m)] ; can use whatever state you want here, just an example [?state :block/original-name ?m] ] :result-transform (fn [result] (map (fn [r] (update (:b r) :block/properties (fn [p] (assoc p "state" (:state r) ) ) ) ) result) ) } #+END_QUERY - Mind that you can open blocks on the right sidebar by:
- holding
Shiftwhile clicking on links or bullets - clicking on a row in the query-table
- holding
I thank both of them ![]()

