Sorting bulleted lists in dataview

What I’m trying to do

I’m trying to use dataview to sort a bulleted list, I tried using metadata, as well as just sorting alphabetically by the file.lists.text but doesn’t seem to sort

TABLE WITHOUT ID rows.file.lists.text
FROM "RST MOB information"
GROUP BY instance
SORT file.lists.text desc

where the page name is RST MOB information
and the list is in the format

  • [link1](page url) (instance:: key value)
  • [link2](page url) (instance:: key value)
  • etc…

what am I doing wrong?

Things I have tried

First of all, with exception of the TASK queries, most queries work on the note level when using Dataview. This means that by default it looks a entries in a list as just that a list or one list. To expand the lists into its separate items, you need to use FLATTEN.

Secondly, the combination of sorting and grouping can cause issues, so you might need to play around with the following query as I’ve not setup a specific test case for this query.

TABLE WITHOUT ID rows.item.text 
FROM "RST MOB information"
FLATTEN file.lists as item
SORT item.text
GROUP BY item.instance

You could also possibly try to use sort(rows.item.text) as Texts as a column, to see if that gives you the wanted output. See sort() documentation.

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