List heading of tagged section


I use #tags to assign notes to projects. In project notes, I do something like that:

list from #my_project
sort "Last Modified"



to get a list of tagged notes. That works fine for notes, as the title reflects the content. However, when I take a note about a project in a daily note, I use a # Heading and put the #tag right below it. This results in query results like:

2023-08-23               <-- heading in daily note
Exchange about project   <-- real note

Is there a possibility to get the corresponding section from a tag (using query or dataview or anything else)? I.e. the note (file) name, when it is at very top of a file, or the section when it is under a section?

Thanks a lot!

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