Translate WHERE line from Dataview Block Query into Dataviewjs Inline Query

Hello everyone. I tried everything to solve it my own but my js knowledge seems to be to limited to understand what is going on. Hope you can help me :slight_smile:

What I’m trying to do

My dataviewjs inline query is supposed to spit out a list of notes that contain a certain link value in their frontmatter.

As a dataview block it works fine and looks like this:

LIST
WHERE contains(up, [[Test Note]])
SORT file.name ASC
LIMIT 10

Translated to dataviewjs inline query I get an error message :x: TypeError: p.up.contains is not a function. My code is (to increase readability I split it on multiple lines):

$=dv.list(dv.pages(‘’)
.where(p => p.up.contains(“[[Test Note]]”) )
.sort(f=>f.file.name,“asc”)
.limit(10)
.file.link)

Things I have tried

I’m sure that the faulty line starts with .where
I studied the Dataview Code Reference up and down but couldn’t find a solution there :slightly_frowning_face:

Any ideas?

Some background information

This issue became important to me after implementing the Dashboard++. There dataviewjs inline queries are used. As I find it easier to create a dataview block, I tried to replace them. BUT subsequently the layout of the dashboard was a mess because the output list items were on the first level instead the expected second level. So, for the case that I won’t get the dataviewjs query working probably I need a solution how to indent the list items of the dataview block query.

:slight_smile: Found a solution and want to share it for the case that anyone else has the same issue:

$=dv.list(dv.pages(‘’)
.where(p => p.up == “Test Note”)
.sort(f=>f.file.name,“asc”)
.limit(10)
.file.link)

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