Skip to content

How to modify this dataviewjs search query to also include tags? #2053

Answered by nkgm
OnesN0s asked this question in Q&A
Discussion options

You must be logged in to vote

To choose an arbitrary file from your vault, replace dv.current() with dv.page('path/to/file').

To filter tasks containing every one of the specified tags, replace tasks.filter(...) with:

tasks.filter(t => ['#example-tag', '#secondary-tag', '#etc-tag'].every(tag => t.tags.includes(tag)))

Bonus tip: to filter tasks containing some of the specified tags, use same code replacing every with some.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@nkgm
Comment options

@OnesN0s
Comment options

@OnesN0s
Comment options

@nkgm
Comment options

Answer selected by OnesN0s
@OnesN0s
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants