Can we filter out the current note from the query? #321
-
Is it possible to exclude the current note from a query? Motivation: Is this possible already? (I am new to obsidian, maybe there is a variable with the current note title that I can use in the exclude part of the query?) Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
Yes, you can use the |
Beta Was this translation helpful? Give feedback.
-
After randomly watching reddit posts, I found someone's suggestion for another thing, this could be used to filter out current day (along with Templater plugin):
|
Beta Was this translation helpful? Give feedback.
-
@Armagedoom, I'm sure that you got it right in your actual daily template file -- but in case someone else reads this thread in future, the following query employs your Templater plugin-based solution will result in an Obsidian Tasks query that excludes tasks contained within the current file (whether that file is a Daily note or otherwise):
(Note: since Templater's variables and functions are evaluated only once, when a new file is created from the template, the query above will stop working if the markdown file is renamed.) |
Beta Was this translation helpful? Give feedback.
-
Until Tasks has its own way to use the query's filename in the search, there is a workaround to do it using dataview. It's written up in full in the user guide: How to get all tasks in the current file It can of course be adjusted to exclude files in the note containing the query, or to use folders instead of exact file paths. When Tasks gets updated to know where the current query is, that documentation page will of course be updated. |
Beta Was this translation helpful? Give feedback.
-
This is now possible with:
I spent about 5 full days implementing it, testing it and documenting it over several months. Tasks is and will remain free, of course. But for those who are able, a donation to support development would be very gratefully received indeed. |
Beta Was this translation helpful? Give feedback.
This is now possible with:
I spent about 5 full days implementing it, testing it and documenting it over several months.
Tasks is and will remain free, of course. But for those who are able, a donation to support development would be very gratefully received indeed.