77
Views
16
Comments
Solved
Different roles cannot enter different screens

I have created a simple screen and have written branch conditions in the login event, but after clicking the login button, I cannot enter different screens separately. What should I do?

Userrole.oml
UserImage.jpg
Puja Rani
Solution

Hi, did you tried what I said yesterday. I don't see a problem here. It works fine. Anyways will again try to explain in steps -

1. Here input parameter is missing. Pass GetUserId() . 

2. As you have custom roles in screen, remove Registered roles check from Doctor and Patient screen (If you don't remove Registered role, then any user who has a active account created in the same platform environment your app runs, will able to login irrespective of custom roles. )

3.  In order to test the scenario, that on login redirect directly to Patient screen, login with user credentials who has only Patient role assigned . 

4. Go to User Management app, you either create a new user (or change your role permission)

5. Created a dummy user .In roles section, search with role name and add.

6. Check this demo link. Username -dummy user, Password-dummyuser123. This will work as per your requirement. Hope this helps!

UserImage.jpg
Puja Rani
Solution

You can manage user roles from the User Management backoffice app. To access it, you can type the following URL in your web browser: "https://<SERVERNAME>/Users" where <SERVERNAME> is the host  name of the server you're working on. 


2025-12-04 09-01-03
Kiet Phan
Champion

Hi, I saw your check Patient Role action has no input parameter.

Is that the problem.


2025-12-04 09-01-03
Kiet Phan
Champion

Otherwise, I think everything else is just fine.

Just add the input UserId to that checkPatientRole and it went well.

UserImage.jpg
Naku Sitsu

After logging in, I can only reach the doctor screen. How can I click the login button to enter the patient screen?

2025-12-12 06-45-53
Nandhakumar Sureshbabu

Hey @Naku Sitsu

Try not to create multiple post of same questions, it will not be encouraged.

Regards,
Nandhakumar S.

UserImage.jpg
Puja Rani

Hi @Naku Sitsu ,

After you add the user Id assign for Patient role check, your code is fine. Firstly, since you have custom roles, then you should removed Registered role check from screens. And second to test the scenario that on click the login button to enter the patient screen, login with the user who has only Patient role assigned. It will work.

UserImage.jpg
Naku Sitsu

And second to test the scenario that on click the login button to enter the patient screen, login with the user who has only Patient role assigned. It will work. 

How can I make modifications about this? Thank you very much!

UserImage.jpg
Puja Rani
Solution

You can manage user roles from the User Management backoffice app. To access it, you can type the following URL in your web browser: "https://<SERVERNAME>/Users" where <SERVERNAME> is the host  name of the server you're working on. 


UserImage.jpg
Puja Rani

adding this for your reference, in case you need more details - https://www.outsystems.com/forums/discussion/7399/how-to-manage-users-and-roles/


UserImage.jpg
Naku Sitsu


I still cannot enter different screens based on different characters. Can you help me?

Userrole.oml
UserImage.jpg
Puja Rani
Solution

Hi, did you tried what I said yesterday. I don't see a problem here. It works fine. Anyways will again try to explain in steps -

1. Here input parameter is missing. Pass GetUserId() . 

2. As you have custom roles in screen, remove Registered roles check from Doctor and Patient screen (If you don't remove Registered role, then any user who has a active account created in the same platform environment your app runs, will able to login irrespective of custom roles. )

3.  In order to test the scenario, that on login redirect directly to Patient screen, login with user credentials who has only Patient role assigned . 

4. Go to User Management app, you either create a new user (or change your role permission)

5. Created a dummy user .In roles section, search with role name and add.

6. Check this demo link. Username -dummy user, Password-dummyuser123. This will work as per your requirement. Hope this helps!

2025-12-04 09-01-03
Kiet Phan
Champion

The only thing caused your problem is you did not logged in with a Patient Role user.

Follow Puja Rani's guide to create Patient Role user, and use that user to login, your website will redirect to the Patient screen.

good luck :)

UserImage.jpg
Naku Sitsu

Thank you for your reply. But I can't open the User Management app, what should I do?

2025-12-04 09-01-03
Kiet Phan
Champion

you need to access it via browser.

https://<your enviroment>.com/Users/

UserImage.jpg
Puja Rani

 In browser you have to open URL- " https://<SERVERNAME>/Users " where in place of <SERVERNAME> provide the host  name of the server you're working on (in your case if your app in hosted in this server as shown in screenshot, then URL will be -  https://rxg.outsystemscloud.com/Users/

UserImage.jpg
Jitendra Kumar

I think this will will help and try to create two new users one with patient role and other with doctor role





Regards,

Jitendra

UserImage.jpg
Naku Sitsu

Thank you very much!!!

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