Utterly simple but sortable Dataview task system (no plugin required, no dataview js)

I’d like some help with setting up a super simple task system that lets me sort tasks. I want to stay close to the Obsidian core features, so I’m only using Dataview.
I like utterly simple things that don’t break easily and that are simple to maintain. Hence this idea:

I want to use this priotority task system:

  1. todo
  2. next
  3. inpr
  4. wait
  5. hold
  6. ship
  7. done
  8. sppt
  9. appt

I’d also like them sorted like this. It’s my workflow.

Things I have tried

I currently have this set up.

This is an example of a task I have in my notes:

- [ ] #task Publish blogpost [[anylink]]

This is the Dataview snippet that gives me a beautiful list with notes and all the task in it. It works well, but it offers no way of sorting/prioritising.

TASK
WHERE Type = "klant" AND contains(text, "#task")
GROUP BY file.link

What I’m hoping for

I’d like to create perhaps a setup like this:
#task/todo or #task/1-todo
and create a Dataview snippet that sorts the tasks per note into a priority list.
If there’s a better way to do this, I’m eager to learn.

The advantage of having hashtags for tasks is that I can create a dashboard with, say, all the #task/1-todo, also showing the note that contains that task.

I just can’t wrap my head around it and the forum posts didn’t help me out either.

Is there someone smart out there that is willing to help out? :pray:

Three alternatives spring to mind right out of the box:

  1. Using Tasks.status groups
  2. Using nested tags like: #task/1-todo, or some variation thereof
  3. Using custom checklists with 1-9 for status

Let’s elaborate each of these a little.

Using Tasks status groups

If you look at Tasks documentation, there are sections on example statuses and custom statuses.

It should be possible to set up a cycle of statuses related to your list of priorities, and use this for sorting and selection. You can possibly also group the various priorities into various status types, which could make queries simpler too.

I’m not really into the Tasks plugin, but out of the box, I think this is the only option providing you with a way of cycling through the priorities by clicking/selecting the tasks.

Using nested tags, #task/1-todo

If you predefine your tags somewhere, it should be possible to use auto-completion to select the various priorities. And you should be able to sort on them using something like either tags directly, or if you’re likely to have multiple tags, then through something like: SORT filter(tags, (t) => startswith(t, "#task)) (untested, but the idea should be solid)

This option doesn’t say anything about what you would use for the actual status. Should they always be empty or checked out? Should they use custom statuses to signify the state?

Another thing with this option, is that it does render those tags within the task text, unless you start doing something like FLATTEN regexreplace(text, "#task/[^ ]*", "") as visual` to clear them out of the text.

Using custom checklists with 1-9 for status

Yet another option would be to change the syntax to something like:

- [2] Publish blogpost [[anylink]]

Where one would add a custom icon instead of the [2] to signify that this is a next task. One advantage of such a scheme is that you it’s really simple on the layout, and to advance to the next stage just up the number. This can also be seen as a disadvantage, as you need to remember what each number means, so you know need to know that [7] is done, or that [4] is wait.

When in live-preview or reading, the icon should tell you what it is, but in editing you would need to rely on memory. In live-preview and reading, it’s also possible to add some texts (if wanted) to help understand the icon.

I kind of like this option, as it leaves the task text very clear and free from clutter. It’s still easy to filter on in queries as you can do status = "1" or contains(lists("1", "2", "3"), status) for any arbitrary group of statuses.

Sorting would come simply by doing SORT status.

This option would require a little bit of CSS setup, but once done, it can be forgotten, and it would leave queries rather simple and to the point.


So that’s three options going towards your goals. Each with their own pros and cons. Do any of them seem interesting enough to move forward with? If so, I’m sure someone could provide a little more meat to the wanted alternative. Combinations of them could surely also be considered.

1 Like

Thanks @holroy for your input. I like the options 2 and 3. Like I said, I don’t want to use any plugin like Tasks. Besided from the fact I (very personally) think it looks “ugly” I want to keep it clean and based on the ‘leave no trace’ principle.

Option 2 sounds good to me, because the advantage is you can always clearly see the status of the task. With option 3 you always have to take some sort of action to remember/visualize it again.

I’m really not strong in programming, even the Dataview snippets sometimes challenge me. That’s perhaps also why I tend to stick to a very clean approach. :pray:

Hopefully, there’s somebody that can help out with setting this up.

Thanks in advance.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.