Get current folder
First of all, this plugin is AWESOME
I was wondering if there is a way to get the "current folder" in the query
So instead of writting:
task from "1. Projects"
I could write:
task from current_folder
Maybe exposing like the current file path (and more contextual information) could help here
This will be possible via this.file.folder once I revamp how the 'FROM' statement works to accept arbitrary variables instead of just hard-coded tags/folders/what-not.
Just a bump. I'd like to have the ability to use the DataView to produce summaries at the bottom of a document, and that seems to require the rework of the FROM statement to support this.file arguments.
My expected workflow where this applies:
- Generate a "Meeting Notes" document from a pre-defined template
- Take notes during a meeting, using QuickAdd plugin shortcuts to insert "Decisions" and "Actions" within the notes.
- The Dataview blocks originally defined in the Template list the collected set of all "Decisions" and "Actions" in special sections at the end.
So a Template file kind of like this:
# {{title}}
## Attendees
- [ ]
## Notes
## Decisions
```dataview
TASKS FROM this.file WHERE decision!=Nil
```
## Actions
```dataview
TASKS FROM this.file WHERE assignee!=Nil SORT BY assignee ASC
```
As I take notes I have QuickAdd Capture macros that will insert decisions:
- [ ] [decision::] {{VALUE:Decision}}
And action items:
- [ ] [due::{{VDATE:due,YYYY-MM-DD}}] [assignee::{{VALUE:assignee}}] action:: {{VALUE:action}}
So I trigger creation of a new "Meeting Notes" file populated from the template, then fill in Attendees and start taking notes. As I take notes, I trigger Capture macros for decisions and action items embedded in the notes body. When I'm done, the end of the notes have a copy of the summarized decisions and action items as well.
You can cheat for now via a WHERE clause:
TASKS WHERE file.path = this.file.path AND decision
This has been a common enough approach and needs a mention in the docs. Do we plan to support this in the QL?
Yes, I'm still looking at dynamic sources for the QL.
Just bumping this, I'd also love this feature!
This has been a common enough approach and needs a mention in the docs. Do we plan to support this in the QL?
How should we document this? As a question in the FAQ, a hint on the FROM data command, both, something different?
I think both. I wish I had the skills to pr this in so we could avoid the doc headache in the first place haha.
What's the status of this? Anything I could do to help?
In current version of dataview you can indeed use this.file.folder, so @nikodemus you should be able to do stuff like: WHERE file.folder = this.file.folder to limit to the current folder.
You can't use a FROM ... syntax, but the above works nicely in my experience.