File.name doesn't match a backlink

First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.

What I’m trying to do

In my current note I have a property value “dependencies” and it holds backlinks to other notes that the current note cannot be marked complete until the other notes are complete.

Things I have tried

TABLE status
WHERE file.name  = this.dependencies

If I just put the text of the note name in the dependencies property this works. But, when I put the links in there it doesn’t. I really want to use the links because I can see all the notes in the left in a specific folder and just drag and drop them into the dependencies property field when I see a dependency. Is there a way to either strip the [] from the result turning it into a text so it works or is there a way to make file.name accept backlinks?

How do the dependencies look like in source mode?

If they don’t look like the following:

dependencies:
- "[[some note]]"

Then they’re not links, but list of list of they look like [[some note]].

I’m just drag and dropping them into the property value, so they look like an underlined link would look in the body of the note. Basically, my problem is that in dataview file.name = “ABC” is a match and works but file.name = [[ABC]] doesn’t. My guess is that is because it expects a string value. I assume I need to convert the backlink to a string somehow or … I don’t know what else.

When you do file.name = [[ABC]] you’re comparing a text with a link. That’ll fail. So either you need to do file.link = [[ABC]], or you could go the other way of doing link(file.name) = [[ABC]]. Either should work, but just for the file the preferred method is to use the file.link variable.

Also note that when using a list of links, you should most likely use a list comparison, and do something like WHERE contains(this.dependencies, file.link) to check whether the local list of links of dependencies contains the link of the current file in the query. This will then carry on comparing links to links, instead of a link to a text.

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