I want to pull my meeting notes that I’ve created during the week into my weekly note, which is created using Periodic Notes. To do this I’m using Dataview.
I found this webpage Aggregating Weekly Notes With Obsidian and Dataview which showcased a way to do it but its not working for me.
let currentWeekNumber = dv.current().date.weekNumber;
.where(n => n.date.weekNumber == currentWeekNumber)
.sort(n => n.date)
I’m getting the following error:
Evaluation Error: TypeError: Cannot read properties of undefined (reading ‘weekNumber’)
at eval (eval at (plugin:dataview), :4:21)
at Array.filter ()
at Proxy.where (plugin:dataview:9418:39)
at eval (eval at (plugin:dataview), :4:3)
at DataviewInlineApi.eval (plugin:dataview:19734:16)
at evalInContext (plugin:dataview:19735:7)
at asyncEvalInContext (plugin:dataview:19745:32)
at DataviewJSRenderer.render (plugin:dataview:19766:19)
at DataviewJSRenderer.onload (plugin:dataview:19350:14)
at e.load (app://obsidian.md/app.js:1:864580)
Can anyone help me troubleshoot this error or maybe knows another way to accomplish this?
Edit: I’m using templater to create templates for meeting notes and periodic notes.
What’s the name of your note? Is it recognisable as a date?
And what’s the name if your meeting notes?
The name of the Weekly note is 2023-W02.
I havent come up with a general naming convention for my meetings notes but i tag them in the frontmatter like this:
date: <% tp.date.now(“YYYY-MM-DD”) %>
(in the dataviewjs snippet i copied in my original post its #meeting but ive changed that to #meeting_notes that in my own vault)
Bonus tip: Enclose pure markdown in three backticks before and after, and if you have code blocks (like dataview) enclose with four backticks.
Most likely are you missing a date in one of your meeting files. Try the following, and check if the date is missing somewhere:
FROM #meeting OR #meeting_notes
Which are you using? You say something, but the query shows the other?
In any case, if you see the one missing fix that.
Another option, which is also a good thing to do is to change
n.date?.weekNumber, as that allows the date to be missing or wrongly formatted without breaking the query.
“Which are you using? You say something, but the query shows the other?”
I’m using #meeting_notes but the code i copied from the website used #meeting, sorry if that was confusing!
So its seems that an old meeting note missed the date tag and adding it made the query work indeed. Now it works just as I would expect, thank you so much!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.