Obsidian Bases, filter and count file backlinks

What I’m trying to do

I’m trying to write a formula in Obsidian bases (gallery view) that counts all backlinks from a file coming from a specific folder, lets call it “Folder”.

Things I have tried

The formula file.backlinks.length gives me all the backlinks from the entire vault. How can I narrow it down to a folder?

Number of Backlinks to File coming from specific folder:

file.backlinks.filter(value.contains("Folder/")).length

1 Like

This could also work :blush: … If I didn’t misread something :sweat_smile:

file.backlinks.filter(value.asFile().inFolder("Folder")).length

or some variations of this:

file.backlinks.filter(value.asFile().folder == "Folder").length
2 Likes

It works. Thank You :grin: