184
Views
5
Comments
Solved
Redirect User to page based on Username
Application Type
Reactive

Good day,

Is it possible to redirect a user after login to a specific page?
I tired doing a switch case in the Login Client Action but that didn't work
Any ideas on how to accomplish this?

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

I understand ☺

You do this


And the same thing for the retail :)


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

Yes, you compare the Username on the login action and based on your criteria, it's moved to the screen you want :)

Do you have a use case? And why by the Username? There are "million" possibilities to the username, and it's not the most common thing to exist. I would understand it if it was based on role or something. But of course, it's a question :)

I have in this post a way of doing that, in this case, it's based on roles, but of course, you can do it based on the username input parameter

https://www.outsystems.com/forums/discussion/67657/show-different-homescreens-after-login-for-different-user-roles/


KInd regards,

Márcio

UserImage.jpg
Anna Dwarika

It's not set in stone to use the username as the criteria. I was using it as an example lol
so for a use case say I have two screens: Order and Vendor and i have two main users: Retail and Vendor
I would like that when Retail logs in they are directed to the Orders screen and when Vendor logs in they are directed to the Vendor screen.
What would be the best was to do this?

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

I understand ☺

You do this


And the same thing for the retail :)


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

Instead of using an IF you can use also a switch, where is a multi if haha where you can add more than 1 condition, and when it comes to the "otherwise condition"(is when any of the conditions matches) it goes to the default screen :)

Glad that I helped you, Anna!!

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