Include children (sub-list items) in query for list times with a tag

What I’m trying to do

Working: list list-items that contain a tag
Wanted: also include children of those list items containing the tag, shown as children of the list items (effectively reproducing the list item and children as they are in the original file)

I don’t mind using JavaScript to do this.

Things I have tried

The following shows list items that contain the tag mytag, but does not include children (sub-bullets) of those items, which I also want to include.

list without id
from "/"
flatten file.lists as L
where contains(L.tags, "#mytag")

I have searched this forum and elsewhere, but I haven’t found a solution. Thank you.

1 Like

Given your flattened list, you’ve also got access to the sub-items in L.children.

This could possible help you to achieve your goals, but you might need to tinker around with how to format this properly.

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