Hi all!
I am having a really hard time with this! I saw a few similar questions on the forums but not a clear way to solve the issue im having.
I am building a CRM of sorts. My data collections are set up with subcollections - so I have:
Collection: Clients
Subcollections: Client_Profiles, Entities
Each entity has a list of profiles - so a Client_Profile document has a doc reference to both an entity and to a client.
I have a listview that is meant to show the profiles of the selected entity, and I am using a dropdown menu for entity selection. I want to filter the list based on the entity chosen in the dropdown.
The way it is currently set up:
Dropdown is a variable list of entities filtered to the client (client is referenced as a page parameter).
I set the options to be the entity doc ID and the label to Entity Name - this seems to work properly.
I then set an action for the dropdown selection to set a page state of the doc reference
The problem:
1) I cannot get the list of profiles to filter. I built a filter into the backend query that states that the Entity_ID field = the page state set from the dropdown selection.
However, when i run a test and change the dropdown selection, nothing happens - so the filter is not working.
2) I cannot figure out how to set a default state on the dropdown/page state based on a variable. Basically, each client has a 'primary entity', and the entity document has a boolean for primary set to true/false. I want the page and filters to default to the primary entity on page load - but cannot find any way to do that.
Any thoughts??