Categorise tasks by "assignee" (inline property) using dataview

Things I have tried

I’ve found various posts that solve aspects of what I’m looking for but not fully.
The closest I’ve come is is by using:

TASK FROM "" WHERE contains(text, "#John")

A task would look like:

- [] #John will do XYZ

In this setup I will have to create a dataview for each individual and if I haven’t created it yet it will not be on my task overview page which is not ideal. Having to tag each note with the assignee is not an issue.

What I’m trying to do

I would like to have a list of tasks, grouped by their “assignee” preferably sorted by creation date (oldest first). The assignee can be a tag or other (preferably inline) identifier included in the tag. Ideally it’s a table.

For context: I write a lot of notes during the day as I meet with people.
From these meetings almost always action items follow. Some of these items (tasks) are for me but others are for those I’ve met with. They are essentially dependencies that I would like to keep track off.

Hi @obsidianUser2, welcome to the community!

I suggest experimenting inline Dataview fields for this. Try annotating your tasks with inline fields, such as “assigned”:

- [ ] Paint back room [assigned:: John]
- [ ] Move furniture into back room
- [ ] Clean up shed [assigned:: Mary]
- [ ] Get lumber [assigned:: John]

Then you can query it and group it by the field, e.g.:

```dataview
TASK
FROM "Scratch/Untitled.md"
WHERE assigned
GROUP BY assigned
```

Here’s what it looks like in action:

1 Like

He Craig,

Thank you for your fast response and welcome.
This definitely gives the intended result, awesome!

I am curious about two more things:

  1. Is it possible to create a second list where I list only the tasks that don’t have any assignee? (i.e. for myself)
  2. It’s not possible to use tags instead of fields? While it works great its just a more characters and syntax to jot down while in conversation with someone.

Good questions, that was interesting to think about.

Yes, you can do the same thing with tags rather than fields. It occurred to me that you might want to assign a task to multiple people, which complicates the query a little bit.

Let’s say this is our task list:

- [ ] Paint back room #john
- [ ] Move furniture into back room #john #mary
- [ ] Clean up shed #mary
- [ ] Get lumber #john
- [ ] Do this one myself

You can use a Dataview query to group tasks by the person they’re assigned to:

```dataview
TASK
FROM "Scratch/Untitled2.md"
FLATTEN tags
GROUP BY tags
```

which looks like this:

To make a list of tasks with no assignees (e.g. yourself), you can use a query like this:

```dataview
TASK
FROM "Scratch/Untitled2.md"
WHERE !tags
```

Which looks like this:

Fantastic!
This is going to be a great addition to my day to day productivity.
I’ve made one small tweak to only show tasks that have not been completed yet by adding:

AND !completed

So the code for my tasks is:

TASK FROM "" WHERE !tags AND !completed

And the code for dependencies is:

TASK FROM "" WHERE !completed FLATTEN tags GROUP BY tags
2 Likes

Very helpful!

i notice a couple advantages to the inline method.

The biggest being the freedom from tag naming conventions

For example using spaces or backlinks:

- [ ] walk the dog  [assigned:: [[@Mary]]]
- [ ] mow the lawn [assigned:: that guy with the nose]

less convenient to type out, unless you use text replacement. I’m thinking of replacing !! with [assigned::

bonus: wilk help break my habit of using exclamations to emphasize!!!

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