28
Views
2
Comments
Solved
How to differentiate between two different user types from system user entity?
Application Type
Reactive
Service Studio Version
11.54.49 (Build 63182)

Hey Outsystems community,

I have two user types within my application, customers and businesses.

Within the application the customer should be able to select a business they bought something from.

I already was able to define different screens, one for the customer and one for the business by using roles.

So my idea was to do the same in the datamodel by using the system user database and extending it with an attribute that determines if the user is a business or not. And this should happen by reading the role the user has assigned, business or customer role.

But when I saw that the user entity doesn't include the roles of the user I'm lost on how to solve this problem.

The big idea of the application is that customers can send warranty claims to the business they bought a product from. Following this the business can see all the claims that are being send specifically to them.


2021-06-02 20-50-04
Márcio Carvalho
Solution

Hey!

But you have the User_Role entity where you get the user role


About your main question: How to differentiate between two different user types from system user entity? 

- To differentiate I would create an extended table for the user and create a static entity with the possible types you can have and the static entity would be used to give the type to the attribute type in your extended table which is an extension for the user (Good ways of having a good data model). After this, you just need to assign to create the records in your extended table to the users you already have or to the new ones and then you can filter the way you want.

Kind regards,

Márcio

2024-03-14 20-41-02
Liam Jordan

Yea my bad, I meant I made an extension table that includes an attribute to determine business or customer. like in the image I added and like you explained.

The User_Role is very helpful and the tip with the static entity too. 

Thank you for the help and your time :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.