Search for open tasks excluding future daily notes

Hi, want to search for open tasks, to make sure i don’t forget something. However, I don’t want to see tasks I created in daily notes for days in the future.

Currently I have a saved search for "- [ ] ", however I have to ignore my future notes, which makes this method error prone.

Is there a way to formulate such a query or is there another way to achieve similar results?

I appreciate any help or hints
Nils

Hey, @Nils. (And welcome back.)

Aside from tagging those future notes with something like #future, or placing them in a separate folder, I can’t think of a way to achieve that through Obsidian’s filtering.

Some relatively simple scripting might solve it, though.

I use the plugin Obsidian TODO. It creates a new window in the right side panel with 4 tabs. On the first, all ToDos for today are collected, on the second all ToDos in the future with a date, on the third all ToDos without a date, and on the last one all ToDos that are flagged “someday” (or so I think). For me that’s the best solution, because normally I only need to see the things for the current day.
Hope this helps.

1 Like

Thank you for your answers!

I would be grateful for some hints. I am sure there exists a regular expression that solves my problem (with the data/query code block), but I have no clue which one …

Oh, nice one. And at least some today note integration is on the roadmap.

1 Like

The main reason why I believe this to be impossible with regex alone is that the engine doesn’t know today’s date. Without that, it won’t be able to filter out the “future”.

If I were you, and I really really needed that feature, I’d put together a Python script that:

  1. got today’s date;
  2. converted the file names of all the daily notes to actual dates (internally);
  3. filtered out those that are in the future;
  4. searched the remaining for active to-dos;
  5. sent some kind of output to a note.

Oh, thank you for thinking outside the box/obsidian! I use every excuse to write some python, so this a very good solution.

My other thought was to use the dataview plugin, and in the next update it will have filtering support for tasks! This will then be an inside obsidian solution, which I prefer (even though I really love scripting in python).

I will post my dataview snippet here when the functionality is available.

If you feel adventurous, you can try my tasks plug-in. It’s still quite bare bones, though :sweat_smile:

I will give it a try! however I think once dataview has the advanced tasks feature, I will use that, just because it already features a lot of filtering features.

Why didn’t you use checkboxes to identify the tasks?

I will need to add the explanation why I don’t use checkboxes to the readme :sweat_smile:

To me, checklists aren’t todos. I have a groceries checklist. Or a daily routine. And so on. These are not tasks I want to manage.
On the other hand I have tasks. They often have a due date. To me they are different from a checklist. And I don’t want all my checklist items in my task list.

I am considering using something like - [ ] #task, but it has a lot of implications compared to how it is now.

FYI: there is a command that you can assign a hotkey to toggle a task in the editor, if you want.

2 Likes

dataview now allows to customize queries using the keyword dataviewjs.

Here is how I filter for uncompleted tasks in notes that have a date in the past in their title. In the second part I filter for uncompleted tasks in notes without a date. Those two lists could be combined.

```dataviewjs
dv.header(1, "Open Tasks");
dv.header(2, "Of Past Days");
var now = new Date();
var today = now.setHours(0,0,0,0);
dv.taskList(dv.pages().file
    .where(f => (f.day < today))
    .sort(f => f.day)
    .tasks.where(t => !t.completed), true);
dv.header(2, "In Undated Notes");
dv.taskList(dv.pages().file
    .where(f => !f.day)
    .tasks.where(t => !t.completed), true);
```
4 Likes

I can’t wait to try this! Thanks!

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