Bases grouping (by property of list type)

Steps to reproduce

When creating bases and grouping by a property that is of type list, the grouping behaviour is not consistent.

  • created a folder with some dummy markdown files with one property called area. area is of type list
  • two notes with exactly same values of area but in different order will appear in different groups. For bases grouping area = A, B is different from area = B, A.

Expected result

  • At a minimum, same values of area should be treated as same. If Note1 and Note2 have area values A, B and B, A, both the notes should belong to the same group.
  • Even better (or possibly configurable), if grouping by a property which is of type list, the grouping should work for each individual property value and each file that has the value should appear in that group (which means some notes will repeat).
  • In the example above, we should get two gropus A and B

Actual result

  • Currently we will see groups A, B and B, A

Environment

SYSTEM INFO:
Obsidian version: v1.10.0
Installer version: v1.9.10
Operating system: Windows 11 Pro 10.0.26120
Login status: logged in
Language: en
Catalyst license: insider
Insider build toggle: on
Live preview: on
Base theme: adapt to system
Community theme: Minimal v8.0.4
Snippets enabled: 0
Restricted mode: off
Plugins installed: 6
Plugins enabled: 6
1: Git v2.35.1
2: Omnisearch v1.27.2
3: Smart Connections v3.0.80
4: TaskNotes v3.24.5
5: Minimal Theme Settings v8.1.1
6: Mindmap NextGen v1.14.4

RECOMMENDATIONS:
Custom theme and snippets: for cosmetic issues, please first try updating your theme and disabling your snippets. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.

1 Like

This behavior is currently intentional. Order in lists matters, so they are not grouped together. Duplicate elements are also possible.

My suggestion is to create a formula that sorts the list elements in the formula (list.unique().sort()) and then group by that formula.

In the future, we may introduce another of list where order doesn’t matter and there can’t be no duplicates.

While your suggestion can fix the order issue (by sorting the list property), we still could not group based on the individual keys (instead of list).
If Note1 has area = A, B Note2 has Area = A, can we get two groups with group A having Note1 and Note2 and B just Note2?
Could anyone think of any approach to archive it using any formula?
If you suggest, we can move this into feature request?

1 Like

It seems that you are asking for a note to be in multiple groups. This is a valid but completely different grouping strategy. I think, you should open a FR and make a case for it.

The feature request seems to be here: Bases: Group By / Sorting improvement when an element has more than one element