I just started with Google AppMaker and I'm having some trouble understanding how the query builder works.
Here is my scenario:
I have three data sources:
- Customer:
- Name
- Project
- Name
- Customer
- Milestone
- Name
- Customer
- Project
Now, I have set up relationships between these models, so that: One Project has one Customer (but one Customer can have many Projects) One Milestone has one Project and one Customer
Now, when creating a Milestone I want the user to first select a Customer and then, when they select a Project, I want the dropdown for the Project to only show Projects belonging to the Customer.
My current approach is as follows: I have created a page called "MilestonePage" that has the Milestone data model set. That page contains a table (non-editable) and a (create) form. The form has two drop downs (Customer, Project) and one text field (Name). My thinking is that the dropdown for Project needs to have its options modified so that the list of available Projects is filtered by the selected Customer. I have looked at the documentation but honestly I can't find a proper explanation of how to use the editor. I have also looked at the Projects Tracker and Project List examples but neither has the configuration I need. My best guess was setting the options to something like:
@datasources.Project.query.filters.Customer._equals
or somehow make use of the relationship by using something like:
@datasources.Project.relations.Customer.item.Project
Needless to say, none of these worked. The last one always gives me the Projects assigned to the first Customer in the table and I have no idea why...
I am willing to use other controls and / or scripts to achieve this but it feels like the solution should be simpler.
Any help would be greatly appreciated.