How to get the Previous Screen name in Reactive
Question
Application Type
Reactive
Service Studio Version
11.53.8 (Build 60995)
Platform Version
11.14.1 (Build 34445)

Hey guys,

just curious, is there a way, in reactive, to get the previous screen name?

I'm pretty sure some of you already have crossed on the following requirement:

"In this screen, the button A should be :

  • labeled 'Save' if it's coming from the screen A 
  • labeled 'Next' if it's coming from screen B"

Usually, we add an input parameter in the screen where we have the button, to know where it came from, but if there was a way to avoid having that parameter, that would be great!

Thanks in advance,

Nelson

Solution

Using Javascript

https://stackoverflow.com/questions/3528324/how-to-get-the-previous-url-in-javascript

You can use this command to know the last URL, then you just need to see a way of getting the name of the screen.

document.referrer

You can use this example

var path = window.location.pathname;

var page = path.split("/").pop();

console.log( page );

https://stackoverflow.com/questions/16611497/how-can-i-get-the-name-of-an-html-page-in-javascript


Thank you Márcio, that worked.

Was wondering if the platform or OutSystemsUI shouldn't have a function with this, but anyway, you solved my case.

Thanks again.

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