Bases: Base-level properties

Use case or problem

I want to filter entries in a base by property that has too many possible values, e.g. filter a list of books by year.

Proposed solution

Define a variable that is not part of any item but that is part of the base, let’s call it currentyear.
Then define a view that would filter by that property (property.year == currentyear).

Current workaround (optional)

Create a view for every year I want to filter by.

Related feature requests (optional)

Title is maybe inaccurate. I think you are asking user defined variables inside base queries i.e. my_variable = 2025 etc. Current workaround would be to write a template that uses my_variable then search and replace that variable with a value. I you want to batch generate views from different property values then you can use programming to generate your base file. Again title may be inaccurate if you meant batch generation.

The idea of dynamic queries inside dynamic queries is too complex to understand and implement. I would rather talk about batch generation of different base views.

A base can’t have properties but a note can and you can reference properties of the note that the base is referenced in using the keyword this

formulas: {}
views:

  • type: table
    name: Table View
    filters:
    and:
    - status == this.status
    order:
    • file.name
    • status
      sort:
  • type: table
    name: Set Status
    filters:
    and:
    - file==this.file
    order:
    • status
      sort:

Then create a note and add a status property to it, link to the set status view and then the table view.

![[testbase.base#Set Status]]

![[testbase.base#Table View]]