Dataviewjs block set a trigger to execute

Looking for a way to optimize a page by setting a dataviewjs block to trigger only when a certain frontmatter is updated on the page.

Can SetInterval be used for this purpose?

So for example if i have two entries in the frontmatter, both a list of links: equipped and backpack,
and there is a dataview displaying my equipped items.
With a script i add an item to the backpack. I only want to refresh the dataview when the equipped attribute changes.

Would it suffice to just check whether the length of the properties are not matching? If they don’t match, execute your query. However, it’s hard to keep the previous result showing. See also post below which covers kind of the same topic:

If you want to update the properties you need to look for solutions using app.fileManager.processFrontMatter().

SetInterval would need some context to run in, which is not the easiest available. You could theoretically use some plugin to trigger it in the first place, like the Startup Template of Templater, but I’m not sure it’s the best way forward.

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