How to get a list of linked notes but only showing a part of their file name?

What I’m trying to do


I use templates to create

  • 1 “master note”
  • n related “sub notes”
  • links to each sub-note from the master note

The sub-notes are automatically named based on the master note’s name.
master note: “I am the boss”
sub notes:
“I am the boss - you wish”
“I am the boss - keep dreaming”


I want to add a dataview query that returns

  • a list (or table) of all sub-notes to which the master note links, BUT
  • only showing the part of the sub-note’s name after the delimiter " - "

I manage the first part fine, but showing only the partial file name of the sub-notes beats me.

Thank you.

Things I have tried

I went through the dataview documentation, tried snippets - even almighty ChatGPT - alas, to no avail.

Try using eithersplit() or possibly regexreplace() to remove the unwanted parts. Either should work with slightly different pros and cons.

I tried - and failed. My current dataview code:

LIST FROM "01 👻 Projects/🎞️ LP Videos"
WHERE contains(, ("<% tp.file.title.split(' - ')[0] %>"))
	AND != "<% tp.file.title %>"

resulting in

and i would like to have only the part of the note title inside the red rectangle.

Does that query return the correct files?

If so try to replace LIST with the following:

LIST WITHOUT ID link(, "<% tp.file.title.split(' - ')[1] %>"

Untested, but it might work… :slight_smile:

You could also try if fails (… or possibly file.path)

Thank you. Yes, the query i shared works and delivers the result in the picture. i.e., the full file name.

adding your suggested code, gives me this:

I’m kind of surprised why your split is not working, as it does work in my case. So here are two queries two further explore your case:

TABLE split(, " - "),
WHERE startswith(,

LIST WITHOUT ID link(, split(, " - ")[1])
WHERE startswith(,
  AND contains(this.file.outlinks,

In my simple test setup with three sub notes, where only the two first are linked from the master note, this results in the following output:

You are my hero :slight_smile:

Your code works, if I put it in the master file - but not in the subs. However, you pointed me in the right direction and I found this solution:

LIST WITHOUT ID link(, split(, " - ")[1])
FROM "01 👻 Projects/🎞️ LP Videos"
WHERE startswith(, split(, " - ")[0])

Giving me the desired result:

thank you so much, friend.

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