Skip to content

How can I filter by page content in dv.pages()? #2071

Closed Answered by Oneechan69
Oneechan69 asked this question in Q&A
Discussion options

You must be logged in to vote

Someone showed me a code sample here to solve it, which I adapted:

let pages = dv.pages();
let rows = [];

for (let [index, p] of Object.entries(pages.values)) {
	var has_tasks = false;
	var content = await dv.io.load(p.file.path); 
	if (content.contains("behind")){
		rows.push([p.file.link]);
	}
}

dv.table(["File"],
  rows.map(v => v) );

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Oneechan69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant