How to get the name of the screenname on client or server actions in reactive web app?
Hello Priya,
Hope you're doing well.
You should be able to retrieve this information using JavaScript:
$parameters.CurrentPath = window.location.pathname;
This will return the current path, in this case:
/ModuleName/ScreenName
So if you split the previous string by "/", you'll end with 3 elements:
["", "ModuleName", "ScreenName"]
$parameters.ScreenName = window.location.pathname.split('/').[2];
This will return only the Screen Name
Use this JavaScript on the OnReady event of the screen and you should be good to go!
Hope that this helps you.
Kind regards,
Rui Barradas
For menu you can keep separate table when redirecting to next screen you can assign the screen name to client. variable
Hi,
1. Assign the below expression to local variable. (Example - ScreenName)
If(Index(GetBookmarkableURL(), "?") = -1,GetBookmarkableURL(), Substr(GetBookmarkableURL(), 0, Index(GetBookmarkableURL(), "?")))
2. Then use the below expression wherever you need the screen name.
Trim(Substr(ScreenName,Index(ScreenName, "/",startIndex:,searchFromEnd:True,ignoreCase:True)+1, Length(ScreenName)))
Regards,
Vijay D
Hello @Priya Naveen
Use below js code
location.pathname.split("/").filter(Boolean).pop()
.filter(Boolean) removes empty strings (falsy values) from the array
.pop() returns the last element of the array.
Hi @Priya Naveen ,
If you don't want to use JavaScript, you can simply create a local variable in your screen and use it as the Title.