Template variable {{title}} of daily note takes name all path

Things I have tried

I would like to show my daily tasks created with Task plugin on my Daily Notes using dataview query and the variable {{title}} from the Templates core plugin. The tasks are all saved in a note named Tasks.

What I’m trying to do

I use this query on the Daily note template:

TASK WHERE due = date("{{title}}")

The problem is that the {{title}} variable gets the path of the file name.

example:

The file name is 2022-12-23 but {{title}} gets 2022/12/2022-12-23 I think because I use Daily Notes plugin with date format like this YYYY/MM/YYYY-MM-DD to save daily notes in folders, but the name of the file is 2022-12-23.

I don’t know what other dataview query use to view the tasks from the selected daily note. Could you help me?

Thanks!

I’m not sure if I understood your issue, but try something like this:

TASK
WHERE due = this.file.day

When title has the format YYYY-MM-DD there’s an implicit field called file.day (a date).

1 Like

Thanks so much! this works perfect!

I tried before this.file.name but doesn`t work, I don’t know about your query.

Thanks!

file.name is a string. With that format you need to convert the name in a date: date(this.file.name).
To compare dates (I guess due is a date) you need to use a recognized date value. In the case, as I said, with title in that format you have the implicit date field file.day

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