Dataview & Tasks sow all tasks contained in a file in a table of multiple files

Hello dear Obsidian community

I have multiple mini-projects in different, with all of them multiple (3-6) tasks, that I manage very well in the Tasks Plugin. Each project has its one file and properties that make it searchable to related cities. For example

**Project 1**
city:: London
finished: blank / true
date: 2023-09-26
deadline: 2023-09-29
## Description 
This is a project 1 in London about subjects
## Tasks
-[ ] View documents
-[ ] Await feedback
-[ ] Fill out documents

Also, I have a landing page that filters all pages that are finished: blank or falso to see which one I still need to be finished, and which I finished. The table shows project name, city, date, and deadline. But for simplicity, I’d love to also query all the tasks (or better, filter those that aren’t done) within the project.

So a line would look like this

| Project 1 | London | 2023-09-26 | 2023-09-29 | -[ ] View documents, -[ ] Await feedback, -[ ] Fill out documents |

Is this any possible in Dataview? I tried to just insert a row “tasks” but obviously, this doesn’t work.

Thank you and all the best :slight_smile:

Félix

I don’t know DataView, but from looking over its documentation a while back this sounds like it should be possible.

Also, when you post examples of text, it helps readers if you mark it as code so we can see exactly what you mean. I’ve edited the post to do that for you so you can see.

2 Likes

Thanks, appreciated!

To me too it seems … doable, but I have no idea how to approach it further. So if anyone did this or has an idea, I’m happy.

Okay, if you’re looking for getting incomplete tasks from a specific project (Project 1 in this case), this is what you can use via Dataview:

```dataview
TASK
FROM "Project 1"
WHERE status = " "
\```

(Ignore the forwardslash in that last line, I can’t figure out how to post the full code block like that without it)

This will display the incomplete tasks from the Project 1 note, in a list.

If the note you’re referencing is inside another folder, you’ll need to alter the path (i.e. FROM "Folder/Project 1")

WHERE status is referring to whatever is between the brackets of the task. So since an undone task, it’s just a space. If you wanted just completed tasks, you can use "x" instead. However, in that case it’d be easier to use WHERE completed. There might be an easier shorthand to find undone tasks, but that’s what I’ve found so far.

However, the code for your task notation in your document isn’t correct, so you need to fix it. A task in Markdown is noted as a dash, space, open bracket, space, closed bracket (- [ ]). You’re currently missing the space between the dash and the opening bracket in the code you posted. With that in mind, your tasks should look like this in your project document:

## Tasks
- [ ] View documents
- [ ] Await feedback
- [ ] Fill out documents

Now, I don’t know how to get your tasks into a single line like you proposed, without getting into DataviewJS, which you might not be up for dealing with yet. :sweat_smile: I think we’d have to get into wrangling arrays and things, and I’m not the most comfortable with all that yet. I’m also not 100% sure you can even show tasks like that without them being on their own lines.

You can post a larger number of backticks (or tildes):

~~~~
~~~
~~~
~~~~