Show and filter on "inlinks"

Sorry if this has been asked already, but I wasn’t able to find it in the searches I tried.

What I’m trying to do

Create a Base that gives a table of all notes that are linked from a given note, plus a field that lists all of the notes they are linked from. The dataview equivalent would be:

TABLE
file.inlinks AS "Links"
WHERE contains(file.inlink, [[note name]])

I have seen examples to get all the files that have a link from the current file using this.file.hasLink(file.file), but I would like to be able to specify the file name rather than the base being embedded in “this” file. I haven’t seen any examples of getting all of the linked from notes.

2 Likes

Hello @cjt3,
To achieve this in Dataview, you can’t directly use this.file when specifying an external note—you’ll need to reference the note name explicitly. Try:

TABLE file.inlinks AS "Links"
WHERE contains(file.inlinks, [[YourNoteName]])

Replace YourNoteName with the exact note title. This will list all notes that link to that note. For the reverse (notes it links to), use file.outlinks. This approach works outside the current file context and gives you full control over the target note. Let me know if you’d like to combine both directions in one table! .

Best Regards,
James Henry

Thanks, James. I understand how to do this in Dataview. What I’m looking for (if it exists) is a way to accomplish the same thing in the new Bases core plug-in (currently in beta).

Hello.

Does the following help?

From: Discord

It helps from the standpoint of knowing that what I’m trying to do isn’t possible and not planned to be added. What I was hoping to do (which I could with file.inlinks() in Dataview) was get a table showing all the files have a specified inlink, and then another column that for each of those files shows all of the inlinks that they have. The file.hasLink(this) function can provide me with the inlinks for “this” file, but not for multiple files in the same table.

2 Likes

Similarly I am trying to build a terminology.base by creating a column function property that shows a list of links to all of the files that have aliases to the abbreviation/acronym. I currently do this using a callout

[!Example]
$=dv.view("900 Templates/Scripts/Terms");

that renders this:

dv.execute(`
TABLE WITHOUT ID file.link as "Term", summary as "Summary", file.inlinks as "Mentioned in", file.etags as "Tags"
FROM "700 Vaults"
WHERE icontains(file.aliases, this.file.name)
`)

Example

Term2 Summary Mentioned in Tags
Direct Preference Optimization Direct Preference Optimization (DPO) has emerged as a promising alternative for aligning Large Language Models (LLMs) to human or AI preferences. Unlike traditional alignment methods, which are based on reinforcement learning, * 2024-05-06 * #excalidraw
Demonstrating Proof of Possession (DPoP) “Demonstrating Proof of Possession,” commonly referred to as DPoP, signifies an OAuth security extension designed specifically for bearer tokens.
1 Like