Select child entity from a dropdown list

As a novice Mendix user, I have a question. I have a domain model with 3 associated entities: doctors, patients and appointments. The doctors and patient have 1-* association: 1 doctor can have one or more patients, patients have 1 doctor. The patients and appointments have a 1-* association as well: 1 patient can have one or more appointments, 1 appointment has 1 patient. I've made the Doctors entity an generalization of Accounts, so when a Doctor logs in, he will only see his own patients.  I've been trying to get the following: I would like to create a page where each doctor has his associated patients in a dropdown. After selecting a patient from the dropdown, the associated appointments will be shown in a datagrid. I've created a page with a dataview for the doctor, which is filled by a microflow that returns the correct Doctor object by comparing the name of the current user with the name of the Doctor. After this I'm stuck: how can I create a dropdown of all associated patients and change the contents of a dataview based on the selected Patient?
1 answers

You need to use the Constrained by function. See documentation here: