ModalForm and Dataview – Dynamically filter queries based on previous input

Hi everyone,
I’m using ModalForm to create a new note and I’d like to know if it’s possible to dynamically filter Dataview field options based on the value selected in a previous field within the same form.

In my case, the form has three fields, all of which are type: dataview:

  • Customer – displays a list of clients (this works fine)
  • N-offer – should display only the offers related to the selected client
  • Description – should display only the descriptions related to the selected offer and client

Currently, each field shows all possible values.
What I’d like to achieve is a chain of filters, where:

  1. I select a Customer

  2. Based on that selection, N-offer is filtered to only show related offers

  3. Based on the selected offer, Description is filtered accordingly

Is it possible to do this with ModalForm?
If yes, how should the form and queries be structured?

Thanks a lot for your help!

To my knowledge a second query cannot access the result(s) of a previous query in Modal Form.
But it’s been a while since a played around with it.
If you ask the dev, he may have a solution or may even implement this.
Feature Request form:

Discussions:

Yes, it is possible.
You can access the current form values using a special variable named form.
Take a look at the docs for examples: Dataview Integration - Obsidian Modal Form docs Let me know how it goes, it is quite an advanced feature

Dan, I think you’d need to write this up point by point. This would be a very important feature of the plugin, if one can achieve this…

Do you mean writting a step by step guide of one example form making use of this feature?

Well, can I answer in the affirmative?

Yes, absolutely. I just want to understand what the people is missing in terms of docs

1 Like

I remember your Share&Showcase thread where we chatted about certain functionality. That it’s a bit hard for the average user.

This is the best step by step guide I was able to write:

Let me know if you have any feedback to improve it
If it is still not clear enough, then someone else should give it a try .

1 Like