★ Aggregate todo list with Dataview, but FILTER OUT checkboxes from forms

Is there anybody out there that can explain how I can create a Dataview codeblock that aggrigates ONLY my Todo tasks?
I’m not a programmer, so simple Dataview lists I can handle, but I can’t grasp this.

The problem is that I have a huge amount of forms in my notes and they also show up in that list. Like this:

I just want my todo collection and not every checkbox in a form I created in my Obsidian notes. :wink:

Any tips? :mechanical_arm:

2 Likes

Is there any way to differentiate these checklists from your tasks? A tag on them, or in each checklist note, for instance?

Sure, I could add #todo between the checkbox and the text, but that would be another (redundant?) action from my side. But yes, that’s doable. :wink:

Would you see a solution then?

The point is: how you tell to dataview to, in front of elements with the same syntax - [ ] - -, distinguish ones from others? There’s no AI in the plugin to distinguish “semantic” differences. :slight_smile:
I don’t know the format of your “forms”. But, besides the @ryanjamurphy suggestion, you have others. For example, if you have different sections/headers to each elements (for example, when forms you can add a specific header) and filter the results including/excluding sections.

1 Like

I am not sure about your vault structure but it could be as simple as move all the forms in a seperate directory and exclude it then ?

1 Like

What the others said! Dataview needs some way to know which items are in checklists vs which are tasks.

There are many many possible ways to do that:

  • Put all checklists in a particular folder and exclude the folder
  • Tag all files with checklists and exclude the tag
  • Tag each checklist item
  • Tag each task item
  • Append all checklist items with some string or character
  • Name all checklist files with a particular term
  • Put all checklists in a section with a particular term

That’s just off the top of my head. I’m sure there’s others!

1 Like

The forms are in notes. These notes are mirrors from pages on my website, for instance: Website estimate ⋆ web design agency Stoere Binken Design

I think this is currently my best chance to add a tag to each #todo checkbox. Makes totally sense that Dataview can’t recognize it any other way.

If I’d do this:

  • [ ] #todo HERE GOES MY TASK
    and I’d add these to random posts, what could the Dataview code look like?

:pray:

I don’t know if you have any specific folder or tag (generic tag) to reduce the source…
But to start you can try this:

```dataview
TASK
WHERE contains(text, "#todo")
```

YES, this works. It even separates it by note. This can become a bit overloaded, but I can work with that. It just needs a bit more space. :wink:
Schermafbeelding 2022-05-07 om 14.18.10

Thanks for this tip! :fist_left:

1 Like

In future versions the groups by notes going away.
If you don’t want this groups, try this (for single title):

```dataview
TASK
WHERE contains(text, "#todo")
GROUP BY "Tasks" AS abc
```

or this (to empty title):

```dataview
TASK
WHERE contains(text, "#todo")
GROUP BY "" AS abc
```
2 Likes

Awesome. For a non-programmer like me, this is very cool. For you this must be kiddy-stuff. :wink:
At least it works like a charm. This was exactly what I was looking for. Thanks for your help.

I’m a non-programmer too… :slight_smile: I just know a little of dataview (dql, not js) by experience…

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