Dataviewjs, specify folder

I have this script, that shows my areas if they have an image.
I would like to define which folder it should look in, similar to From in dataview. Here it looks at that folder and all it’s subfolders.

How is that done in dataviewjs?
And yes, I’m a 100% noob when it comes to js, so the script could properly be much smarter :slight_smile:

let searchterm = dv.current().searchterm;
let pages = dv.pages(searchterm)
	.where(p => p.img != undefined && p.type)
	.where(p => p.type.includes("Area"))
	.where(p => p.type.includes("Private"))
	.sort(p =>, 'asc');
		 .map(p => [
		 `<img class="myTableImg" src="${}/${p.img.path}">`,, 

It’s the same as normal Dataview:

Take a single string argument, source, which is the same form as a query language source.

So just do dv.pages('"Some folder"')

1 Like

So simple, damn I feel stupid now.

Thank you

1 Like

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