Base code - dynamic property selection

What I’m trying to do

I have a template for a note which contains a base code.
The note has a property called baseProperty which contains a name of the property i want to filter within the base.
How can i say in the base code to show values of the property named in the frontmatter so that its dynamic and not set for each note seperately??

To better illustrate the problem - i have many notes called Question XY, each of these questions have a frontmatter property named by a person, and its value is the answer of that person to the question

Question 58.md - a file for a question includes all of the answers of people asked

---
question: "How are you today?"
John: "Ok."
Lucy: "Tired"
Trevor: "Cheerful"
---

and i have a note for each person, i want to have a base in each persons note listing all questions they answered - this can be done statically easily - example:

Johny Smith.md

---
baseProperty: John

---


``` base
filters:
  and:
    - file.tags.contains("question")
views:
  - type: table
    name: "John"  --> make this based on this file's baseProperty
    filters:
      and:
        - "!John.isEmpty()"  --> make this based on this file's baseProperty
```

but how to do this dynamically in a template by calling this file’s property baseProperty?

Things I have tried

i tried this but it has 0 results

``` base
filters:
  and:
    - file.tags.contains("question")
views:
  - type: table
    name: this.baseProperty
    filters:
      and:
        - !this.baseProperty.isEmpty()
```

I made progress with this:

  • the table does filter the correct questions,

but i am not able to

  • see the answer - the property is called this.baseProperty - which of course doesnt exist
  • also the tables name is not renamed dynamically
``` base
filters:
  and:
    - file.tags.contains("question")
views:
  - type: table
    name: this.baseProperty --> ❌DOES NOT WORK
    filters:
      and:
        - file.hasProperty(this.baseProperty)  --> ✅ WORKS
    order:
      - file.name
      - Question
      - this.baseProperty--> ❌DOES NOT WORK
```

I found the solution using a formula: note[this.baseProperty]

``` base
filters:
  and:
    - file.tags.contains("question")
formulas:
  Answer: note[this.baseProperty]
views:
  - type: table
    name: Questions
    filters:
      and:
        - file.hasProperty(this.baseProperty)
    order:
      - file.name
      - Question
      - formula.Answer

```