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:
$= dv.current().foo
works. But as a code block
dv.current().foo
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.list(), dv.taskList() or dv.table() with all their variations, or the simpler dv.span() or dv.paragraph (or dv.el()) for texts. See render functions and other functions from the Dataview(js) documentation.
The similar examples using inline and normal DQL queries would be:
`= this.foo `
```dataview
TABLE WITHOUT ID foo
WHERE file.path = this.file.path
```
That last 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.