Dataview List without id without double bullet

What I’m trying to do

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:
2023-12-13T17:45:18,515843384+01:00

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?

This is similar to the problem discussed here: https://forum.obsidian.md/t/listing-inlinks-for-current-file-always-leaves-an-empty-double-bullet-on-top/57647
However the solution that @holroy gave there does not work in my case.

You need to flatten like this :

LIST WITHOUT ID
	row["Test"]
WHERE
	file = this.file
FLATTEN Test

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?

Or will I have to rename my frontmatter entry to something like: Tea_of_the_Day? I would like to avoid that.

Like in the list, You can simply put the property name in brackets with row.

LIST WITHOUT ID
	row["Tea of the Day"]
WHERE
	file = this.file
FLATTEN row["Tea of the Day"]

That does not work for me. It actualy doubles the results then, but keeps the double bullet.
Here is a picture:
2023-12-13T18:54:55,318331015+01:00

In that case I have two entries in the frontmatter field:

  1. Sencha Yame-Cha (Kyushu)
  2. Gyokuro Uji

But as you also expected that query to work properly, I’ll consider that a bug und will report at github soon.

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

The result:

Screenshot-13_12_2023-20.14.55

I hadn’t checked but this time I checked and it works like this:

LIST WITHOUT ID
	test
WHERE
	file = this.file
FLATTEN row["Test 1"] as test
2 Likes

Thank you very much. That does work, so I’ll consider that a solution.

However as @Anwen has shown this should be possible just with dataview and FLATTEN without changing the css, which would be preferable to me.

1 Like

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.

1 Like

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 :sweat_smile:.

1 Like

I may not have a complete understanding now, but a way better one. So thank you again. I’ll read into the recource you shared.

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