Dataview help please

What I’m trying to do

I want to do a reading list of my books, but i’m a noob and this, i don’t get it wher e is the error.

Table Autor as Autor, ("![500 - 📖Libros](" + cover_url + ")") as Cover, pages, category as genre, rating, 
From "#Libros"
Where contains(status, "#📥/🟥")

Things I have tried

You’re not saying what your error is, and you telling us anything about your data structure.

Yet, I can spot at least one error, and that is that you have an extra comma after “rating”. Try removing that comma, and see what happens.

If that doesn’t fix it, report back with a little more information.

2 Likes

This parses (without data) in local tests:

```dataview
TABLE 
	Autor, 
	("![500 - 📖Libros](" + cover_url + ")") as Cover, 
	Pages, 
	category as Genre, 
	Rating 
FROM 
	#Libros
WHERE 
	contains(status, "#📥/🟥")
```

And FROM syntax for tags:

https://blacksmithgu.github.io/obsidian-dataview/queries/data-commands/#from

Yes. This was the solution. Sorry for my negligence, i’m new to this.

1 Like

Well, now i have another problem. I fixed the dataview table, but now, it doesn’t show up the variables i put in.

Look:


I just want to show up the variables i put in. I tried changing the variables to the Books page but it doesn’t work too.

You’re not showing us how those fields are defined in a page in the Books folder, so it’s hard to tell why it doesn’t work.

Libros < This is the cover
Estado: #:inbox_tray:/:red_square:
Autor: [[Deepak Chopra]]
Título: Las siete leyes espirituales del éxito
Fecha: 2004
Categoría:
Descripción:
Tags: #Libros
Fecha de inicio de lectura: 05-mar.,2023
Número de páginas: 160

And this things are the variables.

First of all a tip on formatting:

Bonus tip: How to present code properly in a forum post

If you want to showcase either markdown, or code blocks, or dataview queries properly in a forum post, be sure to add one line before and one life after what you want to present with four backticks, ````. This will ensure that any other backticks (like for code blocks) is properly shown.

Secondly, if you want to define fields in the normal text, you need to use two colons, as in:

Autor: [[Deepak Chopra]]
Título: Las siete leyes espirituales del éxito
Fecha: 2004

Only one colon is only for the frontmatter, that is the section at the very start of your file, surrounded by --- before and after.

The cover can causes issues, and if you do a search in this forum you’ll see various alternatives on how to solve that when defining it as a field.

---
Cover: https://books.google.com/books/content?id=nTHy6CShrl4C&printsec=frontcover&img=1&zoom=1&edge=curl&source=gbs_api
Estado: 📥/🟥
Autor: "[[Deepak Chopra]]"
Título: Las siete leyes espirituales del éxito
Fecha: 2004
Categoría: Literature
Descripción:
Tags: Libros
Fecha de inicio de lectura: 05-mar.,2023
Número de páginas: 160
Rating: 3
---

```dataview
TABLE WITHOUT ID
	("![|100](" + Cover + ")") as Cover,
	Estado,
	Autor, 
	Fecha, 
	Categoría as Genre, 
	Rating 
FROM 
	#Libros
WHERE 
	Estado = "📥/🟥"
```

1 Like

Well, i have solved the problem with your code. I make test and more tests and get to the problem. I got this conclusion: i’m dumbass at YAML, i need to learn better dataview. THX for your time.

I have a question now, how i can not show certain variables?

Look, i don’t want that text above Aprendiendo de los mejores show. Can you help me?

That looks like it is picking up template data.

If the template it not in the Libros folder, you could change the FROM statement to harvest data from the Libros folder only and not from the hashtag.

FROM 
	"Libros"

Alternatively, if the template is in a dedicated folder, you could negate the template folder but keep the hashtag:

FROM 
	#Libros
AND 
	-"Templates"

Or to negate a named template:

FROM 
	#Libros
AND 
	-"folder name/template name"

All of the above needs to use syntax specific to terms used in your vault.

EDIT: If you don’t want some items in the Dataview table – such as Estado, – you can just remove them. I only added Estado, for local testing purposes.

Good luck.

1 Like

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