Hello,
I’m new to Obsidian and I really like the flexibility. But this can be sometimes overwhelming. At the moment I try to configure Obsidian the way I want to use it by reading a lot of blog posts, listening to YoutTube videos and copy&past config snippets.
At the moment I struggle with this one:
dataviewjs
dv.taskList(dv.pages('-"Templates"').file.tasks
.where(t => !t.completed).sort())
It gives my all open tasks grouped by the page name. But the order of the page seems to be random. I would like to order the output by the name of the page (A-Z). Adding the “.sort()” was my first try. While it doesn’t create a error, the output is still the same.
Any idea how to do it.
Trying to do the same here - were you able to figure it out?
I found out how to do it sorting by page.file.ctime
, which you can adapt for your own purposes of page name:
Didn’t work for me but Jillard
in the discord provided
dv.taskList(dv
.pages()
.sort((page) => page.file.ctime, "desc")
.file.tasks
.where(t => !t.completed && t.text.includes("<inline_search_term>"))
.groupBy(g => dv.page(g.link.path).file.link)
.sort(s => dv.page(s.key).file.ctime, "desc")
, false
)
(replace inline_search_term
)
where the key was adding to the tasks
object:
.groupBy(g => dv.page(g.link.path).file.link)
.sort(s => dv.page(s.key).file.ctime, "desc")
, false
since it seems the original sort is overridden by default