Unable to group by property with link if linked file exists

When grouping by a property that contains links to headers in a file, the base will only group by one header instead of each separate header.

This only occurs if the file being linked to exists. If the links point to a non-existent file, the base will be grouped by the headers.

Steps to reproduce

  1. Create a base.
  2. Add a property with type “Text.” For this example, I named the property company.
  3. Use the “New” button to create several records. In each record, link to a header in a non-existent file.
  4. Group by the property you created. You will notice that the Base groups by the file link and then the header.
  5. Create a file with the same name as you linked to. You will notice that the Base now only groups by the header from the topmost file.

Did you follow the troubleshooting guide? [Y/N]

Confirmed behavior in a sandbox vault.

Expected result

I would expect the Base to group by the headers as seen when the file does not exist.

Actual result

The Base instead groups by one header from the topmost file.

Environment

SYSTEM INFO:
Obsidian version: v1.10.6
Installer version: v1.8.4
Operating system: Windows 11 Home 10.0.26200
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: Things v2.1.19
Snippets enabled: 0
Restricted mode: off
Plugins installed: 9
Plugins enabled: 0
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.

I’m just showing a workaround.

Since grouping is treating links to a note’s headings and blocks as simply links to the note, one workaround is to group by something that is seen as distinct, for example:

company.toString()

or for appearances:

company.toString().slice(2,-2).replace("#"," > ")

As in:

formulas:
  company: company.toString().slice(2,-2).replace("#"," > ")
views:
  - type: table
    name: Table
    groupBy:
      property: formula.company
      direction: ASC
    order:
      - file.name

That workaround is exactly what I needed, thank you!

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