Same query, working in one folder, not in the other

I have the following dataview query I’m using (a lot):

TABLE WITHOUT ID string(link(rows.file.link, rows.title)[0]) AS Note, list(rows.L.text) AS "Text"
FROM ""
FLATTEN file.lists AS L
WHERE 
	contains(L.tags, "#retro")
	or
	contains(L.tags, "#internal")
WHERE contains(file.folder, this.file.folder)
GROUP BY file.link	

What I’m trying to do

My basic workflow is to have a folder stucture like this

Projects/CompanyName/ProjectName/00 - Sprint 1

In the sprint folder are folder like, 00 - Refinement, 01 - Planning, 02 - Story XXX, etc, etc. During my daily work I add tags like #retro or #internal to notes/blocks that will be relevant later. When it comes to the retro meeting I open a new note from Templater where the query is used.

I have a current running project, in the subfolder Sprint 1 until Sprint 7 works perfectly. I think the issue exists after I had to format my laptop and restore my vault from Git. It seems files in folders that are created after the format/restore of the vault are not being caught by the query. Newly created files in folders 1-7 do show up in the query.

Things I have tried

Tried to create a complete new vault, use the same query, doesn’t work. I obviously tried to restart the device, I checked permission settings for the folders and files with “icals” in terminal, example:
icacls "01 - Company - ProjectName" /T > folder.txt

All the permissions seem to be exacty the same.

I’d appreciate any suggestions or tips, please!

Kind regards,

Berry

This is the debug info of my main vault:

SYSTEM INFO:
Obsidian version: v1.5.12
Installer version: v1.5.12
Operating system: Windows 10 Pro 10.0.22631
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: AnuPpuccin v1.4.5
Snippets enabled: 6
Restricted mode: off
Plugins installed: 10
Plugins enabled: 10
1: Various Complements v10.0.0
2: Natural Language Dates v0.6.2
3: Templater v2.3.1
4: Calendar v1.5.10
5: Paste URL into selection v1.7.0
6: Tasks v7.2.0
7: Homepage v3.8.0
8: Style Settings v1.0.8
9: Git v2.24.2
10: Dataview v0.5.66

Kicking this post, hopefully someone can help because I’m kind of getting desperate and frustrated :smiley:

For me, the query works when first written, but if I move the file containing the query to a new folder, the query only runs if I navigate away from and then back to the file, forcing Dataview to refresh.

I doubt that’s your problem. Just adding some diagnostics to the thread in the hope someone else can offer a solution.

Tried two versions of the query. Both work when Dataview is nudged.

```dataview
TABLE WITHOUT ID 
string(link(rows.file.link, rows.title)[0]) AS Note, 
list(rows.L.text) AS "Text"
FROM ""
FLATTEN file.lists AS L
WHERE file.folder = this.file.folder
WHERE 
	contains(L.tags, "#retro")
	or
	contains(L.tags, "#internal")
GROUP BY file.link	
```

- test #retro
- 222 #internal

```dataview
TABLE WITHOUT ID string(link(rows.file.link, rows.title)[0]) AS Note, list(rows.L.text) AS "Text"
FROM ""
FLATTEN file.lists AS L
WHERE 
	contains(L.tags, "#retro")
	or
	contains(L.tags, "#internal")
WHERE contains(file.folder, this.file.folder)
GROUP BY file.link
```

To nudge Dataview which is needed when the query hasn’t changed, but the data the query is depending upon has changed without Dataview noticing it we’ve got a few options: (This typical happens if you just edit the data without switching modes, which can cause a fail at updating the cache)

  • Close/re-open the note with the query
  • Add/remove something, like a space character, to the query causing it to be re-evaluated
  • Switch away from editing mode in the changed note with data. This one can be a little finicky
  • Cause a rebuild of the current view

The latter I’ve used to do with either a Templater and/or QuickAdd script, but I’ve recently supplied a command Dataview: Rebuild current view which you now can attach to a hotkey of your choice to do this whenever you want to nudge Dataview.

1 Like

Not picked up on that update. :scream:

CTRL OPT CMD R now assigned.

Thanks for the update and tip. :pray:

1 Like

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