271
Views
5
Comments
Solved
Redirect to a page after login based on input URL
Application Type
Reactive

Hi everyone, i'm kinda new to outsystems, been in the jobs for like 3 month, i just got assign these 2 task that i have no idea how to do it, so please help me

Problem 1: I want to make it so that when the user are in the login screen, they gonna paste a screen URL(let say Project screen) then when they login in, they get redirect to that screen(the current default is that after login, it direct the user to the Home screen)

Problem 2: At the home screen there is a SearchDropdown that allow user to choose a project, i want to somehow when the user input a URL that contain the projectId, the dropdown will automatically select that project(They say that i'll have to create an Input Parameters on that screen name InProjectId)(the Url is mostly gonna be /John/Home?InProjectId=1)

And when i combine those 2 problems, i'm gonna have it like this

Input Url /John/Home?InProjectId=1 at the login screen -> login -> go to home page with project that have id = 1

If someone have any idea or tip on how to do this, please help me, thank you a lot

Ps: I can't share my oml, it's belongs to the company, hope you guy can understand

2025-02-10 17-24-13
Arun Rajput
Solution

Use this action inside logic of login button. find below image just for the reference.


And provide the url in RedirectToURL widget like this:

Note: You have to take care of warning as we should not use multiple server action inside client action. Just for reference I used it.

2025-02-10 17-24-13
Arun Rajput

Hi John,

Sol for Prob1: Try to use Referred URL action from Https request handler module.

This action will return previous or refered url so let's asume user is on login screen and then paste any screen url but as user is not logged in currently so he will be redirected again on login screen now  when user enters the credentials and clicked on login button here you can use this action to get the refered url.

Find below link for that action.

https://success.outsystems.com/documentation/10/reference/outsystems_apis/httprequesthandler_api/#GetReferrerURL

Sol for Problem 2:

Definitely you need to create input parameter project id inside the screen then fetch the related entity as aggregate inside the same screen and fillter the record by project id input parameter.

By doing this you will get only data related to that project Id.

-Arun

UserImage.jpg
Long Truong Hoang

Ok thank you a lot, I already finish the problem 2. But for the problem 1 I still doesn't quite understand the way to use Referred URL yet(i mean where to put it and how to use it), can you give me a more detail demo for it? Thank you a lot sir

2025-02-10 17-24-13
Arun Rajput
Solution

Use this action inside logic of login button. find below image just for the reference.


And provide the url in RedirectToURL widget like this:

Note: You have to take care of warning as we should not use multiple server action inside client action. Just for reference I used it.

UserImage.jpg
Long Truong Hoang
2022-08-31 11-22-19
Joao Fernandes

Hi John,

In the login page save the User Url in a Local variable and in the login action use it in the redirectUrl object.

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