Dataview/datacards glitches when file path changes

What I’m trying to do

As far as I can tell, it’s because of the dataview code: this.file.link. Whenever I change the file path (either by moving it or changing the file title) of a file which contains any dataview query seeking anything that says “WHERE” with [property] “this.file.link” etc., the dataview query seeks all notes in the entire vault. Because I have over 1000, it lags Obsidian.

Closing and reopening it resolves the problem.

I’ve also figured out that if I cut all text from the markdown (to remove the “this.file.link”) before changing the file path, and then paste it back in afterwards, it doesn’t glitch. It’s manageable, but annoying, and I often forget to do it, and have to restart Obsidian. I was wondering if anyone had any suggestions for how to fix the problem altogether?

1. Try file.path

Change: WHERE property = this.file.link
To: WHERE property = this.file.path

2. Add a specific FROM source

If your query doesn’t have a FROM statement, it automatically scans the entire vault. Using a filter to a specific folder or tag might improve performance.

Example: LIST FROM "YourFolder" WHERE property = this.file.path

3. Dataview (manual refresh)

You can use the Command Palette (CTRL+P) → Dataview: Force refresh… In my dataview settings, auto refresh is off. I use a custom button in the ribbon (Commander plugin) to refresh the view manually (Dataview: Rebuild current view).

What kind of query are you using ? I think I only ever used something like this for small stuff, otherwise I’m using dataviewjs.

`= this.file.link`