Hi Poola,
Please see the screenshot. The best way to be sure that you select what you want is to limit through ‘Selectable objects’ tab. In your case I can't say what makes patient names and doctor names come together, but it can be solved this way.
You can do it by an xpath or by using a microflow that retrieves correct data.
I hope this work around works
Ferhat
I think what Ferhat is saying is, how do yo know what account is a doctor an what account is a patient. Do you have an attribute on account that specifies this, eg and enumeration, or you want to use the user role related to the account? Please take a look at the lecture below. It explains how to use selectable objects.
https://academy.mendix.com/link/modules/221/lectures/1749/4.2.1-Constrain-Using-the-UserRole-Variable
additional information can be found in the documentation
https://docs.mendix.com/refguide9/reference-selector/#selectable-objects