I’m really struggling to create a basic table query in Data view. Here’s the simple query I’m attempting:
dataview
TABLE
FROM "Data/Primary/DB Bookmarks"
WHERE projects = this.file.name
I have a ton of notes in the DB Bookmarks folder, and each has a property called “projects”. In a project file, I’m wanting to query all the bookmarks related to that individual project.
The problem, I think, is that all of my properties are also links to other notes, so in YAML, in a bookmark page, the “project” field is: “[[Anim Vendor - Talent Database]]”, while the project file name is just plain old “Anim Vendor - Talent Database”.
Things I have tried
I tried to use a function to somehow remove the brackets so there is a direct comparison, but to no avail. Any ideas would be super appreciated.
table url, domain, archive
FROM "Data/Primary/DB Bookmarks"
WHERE replace(replace(project, "[[", ""), "]]", "") = this.file.name
If your key projects is a text type of key, I think you could try to use this.file.link (which is another metadata implicit field) or maybe something like link(this.file.name) (link()'s doc) …
(This is untested though )
If the key projects is a list, then you’ll most likely need to use contains() instead of =
@Pch Sorry to bother again. One hiccup I’m having is that this query seems to only work for existing links between notes, but not for new ones I create. Can’t explain it. Attached are some picture to show the issue. Basically, I created a “Test Linked Bookmark” note to link to another note via a “project” custom field. For some reason, it never appears.