Use Dataview to show all meeting notes for today

Summary

I have a home.md file that loads several things for me each day. I’d like to have a list of all pages from the tag #meeting_notes but only get those where the created date is the same as today.

I can’t seem to figure out how to get a where condition to work AND have it dynamically set.

For reference, I have my notes as follows:

Folder: ‘Meeting Notes/2022/12/2022-12-19 - My Special Meeting.md’

In addition, each note as the following tags:

tags:
- meeting_notes/2022/December
- 2022/12/20 
- Tuesday 

meeting_date: 2022/12/20

Things I have tried

$=dv.list(dv.pages('#meeting_notes').where(n => n.date = '2022/12/20').sort(f=>f.file.mtime.ts,"desc").file.link)

$=dv.list(dv.pages('#meeting_notes').where(n => n.meeting_date = '2022/12/20').sort(f=>f.file.mtime.ts,"desc").file.link)

$=dv.list(dv.pages('#meeting_notes').where(this.file.cday = date(today).file.link);

@rwetzeler Although it doesn’t solve your specific question, I can’t help but to suggest that you check out a Meeting Note Templater script created by Zsolt Viczián. He explains it in this Youtube video: https://youtu.be/qIKg_1FNUgk.

Good luck!

You were very close.

Two things wrong:

  1. You can’t do this with an inline query, you need to use a full datablock:
```dataviewjs
dv.list(dv.pages('#meeting_notes').where(n => n.meeting_date === '2022/12/20').sort(f=>f.file.mtime.ts,"desc").file.link)
```
  1. You had n.meeting_date = '2022/12/20'

The single equals sign = is saying that you want to set all of your notes to have that value.

With three equals signs === you are saying “is equal to”, i.e. you are saying "find me all notes where the meeting date is equal to this date.

Thanks this is very helpful!

How would I get the dynamic date instead of hardcoded? I can’t seem to find a way to pass in today’s value instead of a hard coded value per example above.

For example:

```dataviewjs
dv.list(dv.pages('#meeting_notes').where(n => n.meeting_date === today("YYYY/MM/DD").sort(f=>f.file.mtime.ts,"desc").file.link)

moment is your friend. Learn it, love it, it’s great.

n.meeting_date === moment().format('YYYY/MM/DD')

https://momentjs.com/docs/#/displaying/format/

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.