I have a list in my frontmatter (lets call it Test) with three entries (Entry 1, Entry 2 and Entry 3) and want to query these three values of that list with dataview without having the note title first.
So my frontmatter looks like this:
---
Test:
- Entry 1
- Entry 2
- Entry 3
---
Things I have tried
Currently i try to query that with:
LIST WITHOUT ID
row["Test"]
WHERE
file = this.file
But that renders with a double bulletpoint in front of the first output of the list. It seems that dataview expects a toplevel output regardleess of the “without id” part.
Here is an image how it looks currently:
I’ve noticed that if I explicitly tell the list to only look at the first entry of the array with row["Test"][0] it skipps the doubled bullet, but this way i only get the first value.
Is there a way to avoid this and make it clean?
Thank you that works for the given example!
However the Flatten option does not seem work with row["Tea of the Day"].
Because in my actual case i would need to List entrys from a frontmatter list that has multiple words like: Tea of the Day
Is there a way to also use FLATTEN in that case?
To actually hide the bullet point you need a CSS snippet, there’s no other way around it. Try using the following CSS code snippet (hides the 1st level/leftmost bullet and moves everything to the left in its place):
ul.dataview.list-view-ul {
padding-left: 0;
}
The above snippet was tested against the following Dataview code:
LIST WITHOUT ID
row["Tea of the Day"]
WHERE
file = this.file
A I see. I use FLATTEN to give the whole expression a new name and List according to that name. Thank you very much, it worked.
And sorry for my confusion. I am not quite sure what the FLATTEN command is realy used for abnd how it works.
To explain, the FLATTEN expression is used to do the opposite of a group by . It allows you to flatten the result of a list based on a field. So this allows you to access elements of a list by separating each element of the list with a line.
There is more info here: Data Commands - Dataview
Sorry, I don’t know if it’s really clearer in fact .