Dataview list with category next to link

Hi everyone, I have several notes with the following YAML:

---
Type: Documentary
Status: To check
---

Currently my dataview list is like that:

LIST rows.file.link
FROM  "/path"
GROUP BY Type

Which generates a list grouped by Type. Now, I would like to generate something like:

- Documentaries
  - eg1
  - eg2 - To check
  ..
  ..
- Articles 
  - art1 - To check
  - art2
  ..
  .. 
.. 

So, if Status property is not blank then display it’s content next to the file link, someone has any idea to achieve this?

Thank’s.

It could possibly be achieved by using map(rows), and then combine that with choice() on the status field, and then combining that with the file link.

Hello, sorry but I’ve never saw these commands. Could you provide some example so I can understand? I don’t see them in the documentation.

Thanks

Hey,
you could try the following:

LIST map(rows.file.link, (x) => x.file.link + choice(x.Status, " — " + x.Status, ""))
FROM "/path"
GROUP BY Type
3 Likes

Kindness on this forum never ceases to amaze me! Thank’s, works perfectly. Hope this can help others in future :slight_smile:

2 Likes

Do I understand it right that your solution to put your links into categories is to create a note for each link category with the category in the frontmatter?

Thanks.

Yours sincerely,
coreSpotz

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