Hello, I’m totally new to Dataview and Dataview JS. I’m trying to return all of the values of a key “foo” declared inline (like [foo:: a], etc.) in my file. The inline version:
works. But as a code block
it returns nothing. What is the correct way to do this?
You need to use some of the output function within dataviewjs to output text. This could be the query equivalent of
dv.table() with all their variations, or the simpler
dv.el()) for texts. See render functions and other functions from the Dataview(js) documentation.
In your particular case you could use:
dv.paragraph( dv.current().foo )
The similar examples using inline and normal DQL queries would be:
`= this.foo `
TABLE WITHOUT ID foo
WHERE file.path = this.file.path
WHERE clause is needed for the query to only run related to the current file (and not query the entire vault). Documentation related to DQL queries can be found in the “Query Language Reference” in the sidebar of the link above.
I see – works! Thanks so much.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.