Dataview query results and out/back links

Is there a way to have the items returned by a dataview query act as backlinks/outlinks from Obsidian’s perspective? At the moment, they don’t “count” towards the file out/backlinks, which means they also don’t show up in graph view.

I found this post from ~1.5 years ago suggesting it’s not possible, but it seems like it should be, and would be extremely useful. I had hoped to essentially use dataview to build MOCs and use that to organize notes, but the lack of this ability takes some of the wind out of that idea.

It’s a bit restrictive, but personally I use the run plugin for that, which allows you to write the result of a dataviewjs query in markdown in a file.

1 Like

Currently there is no way to properly persist the dataview query result using only dataview, so that its links will appear in link panes of Obsidian. There are however a few approaches to getting this done. Either you could use another plugin like suggested, or you could build Templater code to surround the original query somehow, and let it insert the result of the query into the note.

If this is done with some proper tagging around the query and/or query result, you can achieve persisted query results, and at the same time allow for the queries to be rerun when you want them to. I’ve made this happen in my test vault, but the solution is not clean enough for me to present it here as it is.

Update: This approach would extend the functionality given by the run plugin to allow for pure dataview queries to be inserted between tags similar to their %% run tags.

1 Like

OK, thanks for the info! For the templater solution, presumably you’d need to delete and re-insert to get updated content, right?

For now, I may try lean a little more heavily on tags in graph view to achieve what I was hoping to :thinking:

Given proper (comment) tags you could just run a Templater command which would scan the current file for those tags, and replace according to its own rules. You could most likely also include a button to re-run that command within the file, to make it even more automatic.

1 Like

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