Is it possible to file-embed the results of a query?

Things I have tried

Searching this forum. Trying various queries and ![[-style embedding with wildcards.

This post seemed similar to my question:

But is specifically about dataview (and went unanswered)

What I’m trying to do

Enter a query, like:

path:journal/2021-07

And end up with a list of files that start with 2021-07-* under the journal directory and have their content embedded.

The query does indeed list the correct files, but just as links to the files themselves - no visible contents embedded.

Thanks!

2 Likes

Is doing a bump reply ok…?

1 Like

Turns out there is a plugin that does exactly what you are looking for:

You can get it in the community plugins. But here is the github.

1 Like

hi thanks! that’s very close, but not exactly it:

  • the standard Obsidian queries keep themselves in sync - that is, if i have a tag query in a note and then add that tag to other notes and later return to the query, i’ll see the new items in the query output within having to run any commands. it seems like with this i would have to re-run the expand command every time the query results may have changed.

It does auto update if you have that setting turned on, but I notice the update is a little glitchy. If you are in Preview mode, the query never shows, but if you switch to edit mode, there it is, switch back to preview and its there now.

There is also a Delay setting for some reason. I turned that down.

I added a search, got it to display, then deleted the auto generated text and the <---->, then added another note with the keyword, went back to the code note and it auto generated with the new note included.

Not perfect, but might get you down the road a piece.

I’m looking into this because I want to auto generate MOCs.

1 Like

HM! I misunderstood it.
I’ll install it and play with it now, thanks!

Edit: This definitely gets me most of the way there to what I was after, thanks @Obsidandnancy ! I still think that Obsidian native could add a flag or option to queries for “embed the contents of the resulting files of this query”, but I’m happy enough for now :slight_smile:

1 Like

Yeah, I’m looking forward to Obsidian developing before my eyes and retooling until I get to my happy place. For now, I set up several text expand dynamic MOCs. Having to click on another note and click back to test it was a pain, but once it was set up it works well. Very cool seeing the file names auto generate every time I visit one of the MOCs.

The best part is, unlike dataview, this creates viewable and clickable file names in edit mode. One big issue with dataview is you have to switch to preview mode to see the result.

Glad this helped you out. I think the text expand plugin is under rated.

Lolll I just got your username. Nice.

1 Like

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