# Get all links to the current file with Obsidian and Dataview

> How to get all links to the current file with Obsidian and Dataview.

Source: https://curiouslychase.com/posts/get-all-links-to-the-current-file-with-obsidian-and-dataview/

**Dataview** is easily one of the most powerful plugins for [Obsidian](https://curiouslychase.com/tools/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:

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

The Result:

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.

# Update 2022-11-25

I've started taking [Interstitial Notes](https://curiouslychase.com/posts/interstitial-notes/) and leveraging a [Dataview (Obsidian)](https://curiouslychase.com/posts/dataview-obsidian/) query that gets all list items that match the query for the current file:

```javascript
dv.table(["Notes"],
	dv.pages().file.lists
		.where(li => li.text.includes(`[[${dv.current().file.name}]]`))
		.map(li => [li.text]))
```

This lets me easily capture my atomic thoughts, tasks and feelings in a daily note (I have a [Quick Add](https://curiouslychase.com/posts/quick-add/) workflow for each type that makes it fast) and then collect all of those thoughts, tasks and feelings in the note that it's relevant for. 

As an example, today I worked on updating all of my 404 links to point to their 200 equivalent notes in [chaseadams.io](https://curiouslychase.com/posts/chaseadamsio/). I capture all of my tasks, ideas, thoughts and feelings in my [Interstitial Notes](https://curiouslychase.com/posts/interstitial-notes/) and then use the query above to render something like this in the note:
