Create two different types of Users

Hei guys I ve seen several posts about solutions on how to create two different types of users and wanted to ask a reasoning about my solution.

So in my case I’d have two types of users:

  • Patient: patient that will have survey on their daily health problem
  • Doctor: doctor that will read information about patient problems

Of course they will have two different onboarding flows. A first solution came up in my mind was to create two Data Types as: 1) User (that is the standard one it is created by bubble) 2) User_Doctor that is a data type I will create.

Does this solution will affect negatively the app in the medium term?

Thanks

It’s better to use one User data type. Just add a role field for User.

I agree with @artemzheg , I’d create the User Role’s as an option set, so you would have an option called Roles with Patient and Doctor as role fields. Then, when you have a sign up workflow (or any workflow) you can add a condition which says Only when the user is (search for option: Doctor) for example.

1 Like

Got it.
At the moment, I was implementing it by adding to the User Data Type the field “Is_doctor”.
I was not implementing with the option set. Is it fine then right?

There is nothing inherently wrong with what you are doing there, but it’s not extensible. If you think you will want to add different user types at any point in the future, you should use an option set to define the types and have a type field on the User data type that links to the option set.

1 Like

I’d use an Option Set to determine which ‘Type’ of User the user is (rather than a Boolean field)…

But I’d definielty use 2 additional datatypes (1 for Doctor and 1 for Patient) to store the information about each type of user, rather than storing everything on the User datatype.

1 Like

Yes 100% agreed because you will have many specific fields for a doctor which patients will not have.