I need a dataviewjs query for list elements under a certain header

What I’m trying to do

I have some fileClasses für metadata menu, each of them containing Fields of type Selectwith predefined values.

I want to keep all these value lists in one File so that I can see them on a glance and can write down some documentation.

Then I want to select the list entries under a certain header and present them as select list.

Metadata menu requires a “dataview query which returns a list of strings (dv is available)”. Unfortunately my JS knowledge is not up to the task so I need some help here.

This is a short example of such a file:

---
fileClass: Meta-FC
---
# Server-Kind-Of

some remarks about these ...

- Hardware
- Hetzner-VM
- lxc-Container
- docker-Container

further text goes here

# Service-Kind-Of

some text

- Applikationsserver
- Webserver
- Mailserver
- VirtualWebsite

some text again

Things I have tried

With some looking around in the forum i hacked together a dataview which indeed works:

dataview
table without ID myItems.text as Selectable
from "Meta/MDM/ValueLists/Kind-OF-VL"
FLATTEN list(filter(file.lists, (i) => meta(i.section).subpath = "Server-Kind-Of")) as myItems

gives only the list items I want:

Selectable
Hardware
Hetzner-VM
lxc-Container
docker-Container

Not really nice and unfortunately i need a dataviewjs query.

Can anybody help me here ?

Many thanks for considering !

Norbert

I found it:

dv.page
	("Meta/MDM/Fixed-Valuelists").file.lists.where 
	(p =>(p.section.subpath == 'Server-Kind-Of-VL')).map(p => p.text)

does it.