Using dataviewjs to query keywords in nested tasks/checkboxes

I am trying to use dataviewjs to query tasks (e.g., checkboxes in my notes) containing certain keywords along the lines of this example from Nicole van der Hoeven (which gave me the initial inspiration).

My problem is that I can’t get this to work for indented/nested checkboxes.

What I’ve tried

For example, if my note contained:

  • [ ] my list
    • [ ] my item… keyword_i_am_looking_for

and if I used the following dataviewjs query:

.where(t => !t.completed)
.where(t => t.text.includes("keyword_i_am_looking_for")))

It doesn’t work. This query works fine if the keyword is on the top-level checkbox, but not any of the lower ones.

Any ideas? Am I missing something simple?

Thanks in advance

Hi. Before anything else, please check if you’re using the most recent dataview version.

1 Like

Ahh, that fixed it. My bad. Let this be a reminder to everyone to keep your plugins updated :slight_smile:

Perhaps it is worth having are reminder when you post to the help forum to check any relevant plugin versions before posting?

Anyway, thanks!

1 Like

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