Get all links to the current file with Obsidian and Dataview

Published on 2022-07-26

Dataview is easily one of the most powerful plugins for Obsidian.

One of my favorite ways to use Dataview is to get all of the files that are linked to the current file.

This lets the user embed linked mentions in the document instead of having to use the "Linked Mentions" section of the Obsidian UI.

using the dataview tag:

dv.list(
dv.pages(`[[${this.currentFilePath}]]`)
	.map(page => [page.file.link]))

The Result: ![[Pasted image 20220725165120.png|Screenshot of Obsidian using dataviewjs to get all file links]]

This is helpful if you don't need to see where the file is mentioned and instead just want to see an overview of all the files that link to it.


Find this article useful?

Tags: Obsidian

graphic I made of the colorado flag's C
Made with curiosity in Colorado