Is it possible to stop refreshing a dataview query?

Hi everyone,

I am interested in tracking my daily activity. To do that I have in the yaml frontmatter of my notes the informations of creation and update of a note.
The following example shows a file created the 7th september and later modified the 15th :


alias :
publish:
created: 2022-09-07
updated: 2022-09-15

Then I include in my daily template the following code :

Notes Created Today

```dataview
list
where contains(created, "<% tp.date.now("YYYY-MM-DD") %>")

Notes modified Today

```dataview
list
where contains(updated, "<% tp.date.now("YYYY-MM-DD") %>") AND !contains(created, "<% tp.date.now("YYYY-MM-DD") %>")

The part about the “Notes created Today” works just fine, my issue lies with the second dataview query.
The list I get from this query works, but is refreshed. For instance in my daily note of the 15th , any note updated the 15th will appear in the “Notes modified today list”, BUT will disappear from this list as soon as it is modified at a later date and its “updated” information in the frontmatter is modified.

What I would like to have is a list of every notes I have worked on a given day (but not created on this same day) which would not be modified by changes made at a later date.

I have 3 ideas but I don’t now if they are possible or even good :

1. Is it possible to block the refreshing of a Dataview query using a command I do not know ?
2. Is there a plugin for what I am trying to do ?,
3. Is it possible to put the dataview query in a conditionnal statement based on the date ?
if date==today
a. do dataview query
b. convert query in a list below (which would therefore not be in itself a dataview query and would therefore be immune to later changes
endif

I hope my question is clear enough. I would be very gratefull for any contribution even if you don’t have a definitve answer ^^

I guess in your yaml frontmatter you are also working with a template that modifies your “updated:” category each time you are working on the file? This actually would mean that the issue is not about dataview at all, as your frontmatter value changes regularly and thus doesn’t contain the older modification date anymore.

My only suggestion is to adapt your values manually each time you are modifying a note:

In your frontmatter, change the “updated” category to a list and add a new modification date manually each time you are changing anything in that note:

updated:
  - 2022-08-17
  - 2022-09-15

Ok, I see the idea.
But I am using a plugin named “Update frontmatter time on edit” which automatically does that for me and I don’t have the hand on what it does.
That’s why I am trying first to find a solution which does not involve changing my frontmatter.
But of course, if there is no other solution I am going to try what you just proposed and which seems very sound ^^

Thanks a lot !

Well, then it is exactly this plugin which causes the problem - because how should dataview know about an older modification date if that date no longer exists in your note’s metadata?

You are 100% right

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