Trying to get the previous external page using getReferrer
Question
Application Type
Reactive

Hi everyone!


I have an Outsystems Reactive App that is called from external urls. I am trying to save this external url, so when the user clicks on a "Back" button, it goes back to the site where it came from. 


To do so, I am trying to use the action: GetReferrerUrl.

I put it on the Initialize of the page. 


However, the value it is saving is the url of my own page, not the previous page where the user was before. Does anyone have a clue what am I doing wrong, or if I should make it in  a different way?


Any help is appreciated. 


mvp_badge
MVP
Solution

Hi Bruna,


You can do that easily without going to the server, using JavaScript:

 

Using the JavaScript snippet below, you will get the previous URL in the ReferrerURL output parameter.


Kind Regards,
João

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