Can I embed the dataview results?

I would love to see the contents of the dataview results like using exclamation mark.
Can I?

Yes, using block embeds:

If you embed the block that the query is in from another note, the Dataview will render inside the embed.

1 Like

I saw that but I couldn’t make it work.
Can you show me an example?

e.g.:

```dataview
TABLE WITHOUT ID
	file.link AS "Empty Notes", file.path AS "File Path"
WHERE file.size = 0
SORT "File Path" ASC, "Empty Notes" ASC
```
^555666

then, in the other note:

![[Empty Notes Query#^555666]]

sometimes* you need to put the block-id in the next line…is the trick

  • otherwise we get Unable to find section #^555666 in Empty Notes Query

* same with plantuml diagram embedding…
…so it must be the backtick fence…?

It didn’t work.
It showed the queried list. I want to see the content of the notes listed in the query.

…if i understand you correctly, you don’t really want dataview result embeds at all…

…contents of the notes can be pushed to lists and tables using dataviewjs’s dv.io.load function…

Same response as Yurcee basically: Ah ok, I misunderstood your intent because of the word “embed” and “exclamation mark”. You want a Dataview query that shows content.

yep :slight_smile:

There is no solution without dataviewjs?
I don’t know how to use it yet so I’m just checking before studying how I could do it.
How is the “embed” function mentioned before used?

it depends on your query and mostly on the content (how you organized your content) in the queried files
apparently, if you have tasks and bulleted list items in files, normal dv query should suffice

otherwise long lines of content need extracted reading the content of files with the function mentioned

so you need to look around on the forum which types of content is similar to yours and maybe you luck out with plain dataview (look up e.g. (meta(item.section).subpath) and the official DV docs)

otherwise adding the dv api to your javascript and asking a bot can also pay dividends – just show the bot the function dv.io.load and how p.content is added in scripts by others

so you need to look around on the forum for ideas, structure and functions used and maybe even tailor your content to how it’s easiest to query it in the long run…

1 Like

I think that maybe setting a new property named “Overview” will be easier…

and by querying for that you expect your list or table populated with actual lines of content?

1 Like

search dataview p.content on the forum and see how the scripts are structured

then write your prompt (requirement) to chatgpt4 showing your example files with content

the robot can help

1 Like

Yes. I would love to see a table for notes and their content or a summary of what that note has. My vault has notes with short contents as little objects for my TTRPG sessions. I saw once a vault using summary exactly for that and thought if I could show the content without it.

TTRPG people have javascript all over their vault what they probably use with dv.view function with some arguments i reckon
i am not one of those people tho…

1 Like

Maybe not entirely what you are looking for but who knows:

2 Likes

@JayKim yeah that is useful indeed!

@pedrogsribeiro see, this what i was talking about when i meant structure of notes…


now i understand what you meant…

you wanted to add ! in front of a p.link, right?

never tried it but i do remember having a hard time trying to add attachments to tables with that method (i tried with dvjs) as it always brought the [[link]] part to the next line, separating it from the ! embed syntax character…

…maybe someone has a workaround for that…i didn’t follow this up to the end (sometimes you need to read the issues pages of plugins on Github)…

1 Like

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