I have notes for different appliances (air conditioners, humidifiers, car, etc.) that have info on the purchase date, link to the pdf manuals, memos, and a maintenance log in each note. The maintenance logs are in this format in each note, usually with other text above and below:
### maintenance log
- 2022-12-28 - 水内部クリーン (初めて)
- 2023-01-27 - manually wiped filters and dust boxes.....
- 2023-02-28 - 水内部クリーン (14:22~18:25) #maint
…and so on.
What I’m trying to do
Collect all maintenance tasks under the same header together in a table or list with or in context.
Things I have tried
- Adding a #maint tag to the last date entry in each list and using Obsidian’s embedded search:
```query
tag #maint
```
Pros: Easy Grabs any #maint tag.
Cons: Even with “Show more context”, I’d like a bit more. Have to manually move #maint to the last entry each time - not difficult but need to remember to move the tag.
- Using regex to query for - NNNN-NN-NN
```query
path: /^- (?:\d{4})-(?:\d{2})-(?:\d{2})
```
Pros: Historical record for each note.
Cons: Picks up every date in a bullet; too many even if defining the path:
to where the maintenance notes are. Will be ridiculous in a year or two. Order is random.
- Decided to try Dataview (beginner
)
LIST file.lists.text
WHERE contains(file.etags, "#maint")
Getting close to what I want…
- Thinking it might help defining a FROM, I changed it to this which gives the same results as above but in a different order.
LIST file.lists.text
FROM #maint
Pros: #maint only needs to be in a note once (in-line or YAML). Provides context and maintenance history at a glance.
Cons: Returns every bullet in the note, which is usually fine but, there are some outside of the ‘maintenance log’ heading that I don’t need or want to see.
- I also tried changing a few of my bulleted dates to
- [x] 2023-03-10
and using:
TASK
FROM #maint
WHERE completed
…and it returns everything important, but isn’t separated out by appliance/note which I’d like to have.
Thanks for following along if you’re still here! So, my questions:
-
Specifically related to Dataview - is there a way to narrow down the results so only bullets under a specific heading that contain at least one #maint tag are listed?
-
More broadly, Dataview or not, can anyone see a different or more efficient way to query these notes to return only the bullets under the ‘maintenance log’ headers (tags or not)? Thanks for any input!