Two different roles within same User? how to structure?

I have a project where a provider and a potential client will be registering and acting. (Each one with his own scenario)

It might be so that user with the same ID might be acting as a provider and as a client depending on the case…

Do have to create separate data types for “provider” and for “client” and how are they gonna be linked to the user? or is it a user with the list of fields both for provider and client?

If you could provide a bit more context on your app, that’ll help in guiding a more targeted response.

Generally, you can approach from a few different perspectives. But here’s a method for initial consideration.

Place a boolean flag (yes / no) on the user to indicate if they meet a certain “type” for your application. (Ex. is_seller = yes, is_buyer = no). In theory, you can enable to sign up as one or both.

Then, within your application, you can “guide” experiences by having a “mode” setup. The mode itself would be a text field on the user profile, where you store a text value. (So, a user can “switch” between their buyer and seller account by clicking a toggle button somewhere on the page if they have both account types set up. Only show this toggle when it should actually be there).

As you started to allude to, it’s good to “segment” activity out into different data types, which would keep your User table a bit cleaner. (Ie. in your database, you create a “seller” profile data type and a “buyer” profile data type. (Then you record transactions, as relevant, on those profiles).

Dan (creator of LearnTo - 15+ hours of Bubble tutorials and live coaching)

This topic was automatically closed after 70 days. New replies are no longer allowed.