List of already assigned values from a property-keys

Hi there,

How can I generate a list of all the already assigned property-values of one specific property-key?

For example, I have a property-key, called β€œcity”, and sometimes I have one city-value and sometimes more than one city-value assigned to that key, e.g.:


β€” note1β€”

---
city: Los Angelas
---


β€” note2β€”

---
city: Florida, Los Angelas
---


β€” note3β€”

---
city: Florida, Munich
---

=> Now, I want to produce a List of all citys, I already have assigned, like:

  • Florida
  • Los Angelas
  • Munich

… I found a helpful thread here:

, which produces the following output:

  • Los Angelas
  • Florida, Los Angelas
  • Florida, Munich

=> but I want to generate a list, where every city only occurs one time

Do you have an Idea, how to accomplish that with dataview, or is it necessary, to use dataviewjs for that job?

Thanks in advance,
kind regards,
Silias

If your city key is of type list…

E.g.:

---
city:
  - Florida
  - Los Angelas
---

… this query :

```dataview
LIST 
WHERE city
FLATTEN city
GROUP BY city
```

Seems to return a list of unique city across the various notes containing a city key:

- Florida
- Los Angelas
- Munich

But I’m not enable to make it work for a text type city key :pensive:.

I hope someone more experienced with Dataview than I am (:sweat_smile:) will be able to give you an appropriate query :blush:.

Thank you very much, that was exactly the view, I was looking for! :slight_smile:

… Meanwhile, I discovered this extreeeemly interesting showcase:

which describes a solution for my actual usecase, … the actual reason, why I wanted to generate that List-view as a first step.

I hope strongly, that this kind of feature becomes a core feature of Obsidian!!! :slight_smile:

1 Like

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