How to crate a base which lists all the outgoing links in this file

What I’m trying to do

I am trying to crate a base which lists all the outgoing links in this file.

Things I have tried

checked the available functions, but see only outgoing links functions.

file.hasLink(this)

This lists other files which point to this file. I need the list of files which this file points to.

Hi.

This should list links from the current file:

```base
views:
  - type: table
    name: Table
    filters:
      and:
        - file.name == this.file.name
    order:
      - file.name
      - file.links

```
2 Likes

Reference for the above:

https://help.obsidian.md/bases/syntax

1 Like

The links now include the base file, too, see screenshot:

Is there a way to hide in_links.base and out_links.base from the outgoing file links list?

You’d need to use a formula property :blush:

For example:

file.links.filter(value.asFile().ext != "base")

(which removes all the .base file from the list of file.links)

1 Like
file.links.filter(value.asFile().ext != "base")

hides the .base files in the in_links.base base file proper, but if I insert this file into another file with

![[in_links.base]]

the .base files still show up

it works, sorry. thanks!

@Pch
There might be some kind of a bug with the file extension filter.

When I apply

file.links.filter(value.asFile().ext != "base")

It indeed hides all the .base file links from the view.
But when I add an outgoing link to the file, which has an inserted/referenced base

and the in-links.base contains this code:

views:
  - type: table
    name: Table
    filters:
      and:
        - file.name == this.file.name
        - file.links.filter(value.asFile().ext != "base")
    order:
      - file.name
      - file.links
    columnSize:
      file.name: 186

it shows the base files along the newly inserted link:

The file links you’re displaying in the embedded base represent what Obsidian’s registered as the outgoing links (for each file the base returns based on your filter(s)) :blush: .
It’s the unfiltered value of all the outgoing links … including the .base files… and it can’t be modified directly…

So, if you wish to filtered out the .base files from the value of file.links and display it in your embedded base, you can only do so by adding a formula property which would output file.links minus the .base files…
You would then display the “file links formula property” instead of Obsidian’s implicit key file links.

That’s what this implied:

… Sorry if I wasn’t clear enough :see_no_evil_monkey:

The formula I shared before wasn’t meant to be used as a filter but as a possible answer to your question:

If you look at the screenshot here, you’ll see that the first column is the same file links from your last screenshot: It’s Obsidian’s implicit key file.links which displays the .base files, as its value is unfiltered :blush:

The last field/column, on the other hand, is a formula property in which the .base files have been filtered out from file.links with this formula:

file.links.filter(value.asFile().ext != "base")


You could then use/display that formula property in the (embedded) base instead of Obsidian’s file links :smile: .

Again, sorry if I wasn’t clear earlier :see_no_evil_monkey:
Although, I’m not sure it’ll be clearer now :sweat_smile: :see_no_evil_monkey:

1 Like

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