How to filter a combobox in a Form

I’m trying to make a simple message functionality in which I want patients to be able to send a message to their therapists.

The thing is that I need the patient to be able to send a message ONLY to a his own therapists.

This are the relations:

I’m struggling to make this work. Any ideas?

Thanks!

Hi @dschindl (Daniel)

It appears your relationships (connections) are incorrect. It would be best to have patients “feeding” into the therapists. Thus a patient is assigned to one or more therapists. If you do that you can then create a form whereby the patient can select the therapist in a drop down menu. In the Page Builder of the form, the field that would list the therapist’s name can be filtered to only show the ones associated with the patient.

As it shows in your picture you have a circular relationship with patients; that won’t work.

Hope that helps,
Adam

Hi Adam, Thanks for your reply!

In my model, Users are Therapists and I have a connection between Patients table and Users table like this:

In which one Patien can have many Users (Therapists).

Hi Daniel-

Your picture shows a circle relationship. Remove the connection FROM the Users table TO the Patient table.

This should do the trick.

Hi Adam! Thanks again for your help.

The problem with that is that the second relationship is because a I have another user “role” which is a patient. And the details of the patient are in the patient table.
That’s why I have two relationships.

One is to relate PATIENTS with it THERAPISTS (which are in the users table). The other is to relate PATIENTS (also in users table) with PATIENTS DETAILS (in patients table).

Thanks again for your help!