Dataview with internal images not showing notes without internal images in YAML

What I’m trying to do

Hi everyone.

I am trying to create a dataview list of books I am currently reading. I would like the list to include the cover image of the book, if available. If the book note does not contain a cover image the book should still be shown in the list. Some of the book notes include a cover image, some don’t.

But … the dataview I have created does only show the books with a cover image.

This code:

gives this result:

It shows fine in the list if other data is missing, e.g. year.

Things I have tried

For the notes without a cover image I have tried:

  • leave cover in YAML empty; didn’t change anything
  • delete cover in YAML; didn’t change anything
  • If I in the code remove the part regarding embed cover then the list correctly shows all the books - but without cover images. This code:

gives this result:

What am I missing here?

I found the solution. I deleted “(meta” and the last “)” in dataview, so it just says: embed(link(coverlocal, “50”)) as “Cover”

The list now shows all the books, no matter if a cover image is included or not in YAML.

Just for the record, I believe what you’ve experienced is a somewhat random bug in dataview which I suspect is related to parts of a command causing an exception without being handled properly.

In your case it can seem to be the call to meta() for one of the missing variants causing either that function to fail miserably, or possibly the attempt to use that null value afterwards.

Anyways, I’m glad you found your solution.

1 Like

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