Several Basic List Queries Stopped Working - Please HELP!

Things I have tried

I confirmed both Dataview and Obsidian are up to date:
Obsidian version: v1.1.15
I updated Dataview just this morning (note that this issue started prior to this update; unfortunately I’m unsure of the exact date that it started).

What I’m trying to do

I have “People” pages in my vault where I use Dataview queries to pull lists of content those people have authored. Many, but not all have stopped working however, I’m driving myself insane trying to figure out what’s different between the ones that are working and the ones that aren’t. Here’s an example:

This query is working:

LIST
WHERE Author = "[[Emily Sadri]]" AND Source_Type = "articles"

image

image

One of the articles that shows up in this list contains this data:

In the YAML Frontmatter:
Source_Type: articles

In-line:

  • Author:: “[[Emily Sadri]]”

This query is not working:

LIST
WHERE Author = "[[James Clear]]" AND Source_Type = "articles"

image
image

Here’s the data in one of the articles I’m expecting to show up in this list:

In the YAML Frontmatter:
Source_Type: articles

In-line:

  • Author:: “[[James Clear]]”

Does anyone see something I don’t? Any other troubleshooting suggestions? I’m driving myself nuts so any assistance is GREATLY appreciated! <3

I think you’ve got a combination of issues here:

  • Invalid YAML renders the whole YAML useless
  • "[[Emily Sadri]]" is not a link, but a text (or string)
  • String comparisons can work, but they’re not comparing links to each other

Try a note with the following text to see what I’m talking about:

---
Tags: f55249
Full_Title: Mental Models: How to Train
---
questionUrl:: http://forum.obsidian.md/t//55249

AuthorS:: "[[Emily Sadri]]"
AuthorL:: [[Emily Sadri]]

```dataview
TABLE WITHOUT ID typeof(AuthorS), typeof(AuthorL), meta(AuthorL), typeof("[[Emily Sadri]]"), typeof([[Emily Sadri]]), Full_Title, file.etags
WHERE file.name = this.file.name
```

This produces (in 1.1.9) the following output in reading view for me:

Note how there is a difference of the type of AuthorL and AuthorS, and if you tried only the AuthorL allows for the meta( ... ) to be called upon it. In addition in the image above, note how there is no output for file.etags, whilst if we correct the faulty Full_Title: ... line into:

Full_Title: "Mental Models: How to Train"

We get the all the data from the frontmatter:

So you should loose the quotes in the normal text, and add them in the frontmatter. And after making the Author:: [[Emily Sadri]], you should also change your query to become:

```dataview
LIST
WHERE Author = [[Emily Sadri]]
```

This will be a link comparison, and not a string comparison. An even safer version would be:

```dataview
LIST
WHERE meta(Author).path = meta([[Emily Sadri]]).path
```

Which would allow for either of the links to be aliased or subpath’ed, but still be considered the same. In the image below, the markup for AuthorL is AuthorL:: [[Emily Sadri#subpath|Alias].

As can be seen in the first column, the simple link comparison fails, whilst the second column shows the meta(...).path says it’s the same link. And the last two columns shows all the meta information on the link, and how it’s the path element which is actually equal if you change the link by adding header/block references, or a display alias.

1 Like

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