27
Views
5
Comments
Solved
How to get the name of the screenname on client or server actions in reactive web app

How to get the name of the screenname on client or server actions in reactive web app?

2020-05-07 18-53-00
Rui Barradas
 
MVP
Solution

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

2025-12-29 06-17-15
Deepak Raj M

For menu you can keep separate table when redirecting to next screen you can assign the screen name to client. variable

2025-01-24 12-41-20
Vijay Dhasnamoorthy

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

2024-07-12 05-57-50
Gourav Shrivastava
Champion

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. 

2026-01-28 16-57-48
Mihai Melencu
Champion

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.


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