Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to get the current view in client-side script

bonsai
Mega Sage

We use "RP.getViewName()" to get a view in a server-side script, but how do we get the view name in a client-side script?

2 ACCEPTED SOLUTIONS

Harish KM
Kilo Patron

Hi @bonsai you can use the below script to check view name in client script

 var view = getView();
 alert("test"+view);
if(view == 'ess')
{
alert("inside");
}
Regards
Harish

View solution in original post

PPPanchal
Mega Sage

Hello @bonsai ,

Using getView() method you can get view name in the client side.

 

 

Please mark correct/helpful if this helps you!
Thanks,
Pratiksha
✨ServiceNow Rising Start 2025

View solution in original post

8 REPLIES 8

Harish KM
Kilo Patron

Hi @bonsai you can use the below script to check view name in client script

 var view = getView();
 alert("test"+view);
if(view == 'ess')
{
alert("inside");
}
Regards
Harish

Where did you learn about "getView()"?
It doesn't seem to be listed in the references either. .

oh!
I thought it could only be used with "g_list"!