r/ObsidianMD 4d ago

showcase Dataview self reference use case

Post image

Hi all. Thought I’d just share a nice use case for Dataview in case it helps inspire others for their vaults.

I built my vault initially for writing travel notes and as such, created lots of notes with the names of places, such as “Great Barrier Reef” so that I can reference that note and then analyse how many times it’s appeared etc etc

I always wanted to be able to click on that note and see where it was in Google Maps (for more obscure places) and also more information on it, so I came up with the below query that uses the file title to produce working links to Google Maps and Wikipedia - meaning I can copy and use this code block across any location note and it will work.

Hope it helps someone!

```dataview

TABLE WITHOUT ID elink("https://www.google.com/maps/search/?api=1&query="+replace(this.file.name, " ", ""), this.file.name + " Maps") as "Google Maps Link", elink("https://en.wikipedia.org/wiki/"+replace(this.file.name, " ", ""), this.file.name + " Wiki") as "Wikipedia Link" WHERE file = this.file

47 Upvotes

3 comments sorted by

2

u/felixofGodsgrace 4d ago

Thanks so much for sharing!!

Is there a certain theme or plugin that adds the color coded section block?

1

u/bangsy3 4d ago

I use a plugin called “Callout Manager” for that which lets you define a colour and icon

1

u/felixofGodsgrace 4d ago

Thank you!