I have a file with writing prompts per day of the year wrote like this : 04/02 - Writing prompt.
In the template of my today’s journaling note I would like to find in that file the line matching the date of today. I can easely modify the first file to make it easer to retrieved the data, but I have no idea at all how I can do it.
My guess is that I can prefix all dates with date:: and use dataview to find in content something like contains(“MM-DD”) but I have no clue on how to do that.
I found the solution using query instead of dataview
file:"<name of my file>" content:"MM/DD"
The ouput above does not suit me though, I just want the line found, not the whole query output, any way to do that ?
I still don’t quite sure about what you want.
Let’s say you populate your notes with inline fields like this:
# My note
prompt:: 04/02 do this and that
prompt:: 05/02 do other thing
Then you can use a query like this:
TABLE filter(prompt, (p) => contains(p, "04/02")) as Prompts
This is a tricky way, because for now you can’t query the content of your note.
But there’s a way to query the content of tasks!
So, using tasks is another option, together with inline fields . Something like:
# My note
- [ ] do this and that (duedate:: 2022-02-04)
- [ ] do other thing (duedate:: 2022-02-05)
With this option you can use a task query:
WHERE duedate = date(2022-02-04)
Perfect, I adapted my files to match your idea and it works perfectly, thanks a lot!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.