Apply a filter on a database depending on the document it belongs

Hi,

I have a Tasks database. This DB has several views (i.e. set of filtering and grouping), like "To do today", "To do this week", "Completed", "To Schedule", etc.

A given task may be associated to a project. I have a Projects database too, with a bidirectionnel relation Tasks <-> Projects.

In the DB Projects, for each project I have an bind block, document type. That is, each project has its associated document block, where I want to put / display all the info about the project, and the tasks of the project too.

So, in a given project document, I want a mirror copy of the Tasks database, with a specific (or dynamic) filter to see only the tasks associated to the project.

Is there a way / a trick to filter the Tasks database depending on the project document where it belongs?

For example, it is possible to use SQL Query in a Database embed content block to filter only on the tasks of the project?

I don't want to have to create manually additional views for each project in the Tasks database. My views are status oriented, not project oriented. And I have many projects, it would be a lot of maintenance. Not a good design to have to create a new view for each new project.

The best would be a way to apply a meta filter on all the views of the Tasks database to keep only the tasks related to the project.

PS: the possibility to filter dynamically a database depending on the context (i.e. the document where it belongs) is a very important feature for databases, to unlock their full potential. It is already implemented nicely in:

  • Notion. The feature is named "Self-referential filter"
  • Obsidian, with the new "Bases" feature, there are two opportunities to apply filters: at the global filters level where they apply to all views in the base, and at the view level where apply only to a specific view. So we can filter all the views on a specific project.

Thanks. I love the program btw!

    Related articles

    Welcome to here!

    Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.

    Signup About
    Please input reply content ...