How to get view name in UI Action script

dp11
Tera Guru

Hi,

In a UI Action's script, how do I check if the view is ess? Tried the following from an earlier posting but it didn't work

RP.getParameterValue("sysparm_view") == 'ess'

Thanks!

4 REPLIES 4

Naveen4
Kilo Guru

Hi,

 

Hope this helps.

https://community.servicenow.com/community?id=community_question&sys_id=bee343e5dbd8dbc01dcaf3231f9619aa 

 

Thanks,Naveen

dp11
Tera Guru

Naveen, thanks for the link. That is for Server side and I was looking for client side. I found the following worked:

if (getView() == 'ess'){

//code

}

Glad that helped you.

 

Thanks,Naveen

BALAJI464
Tera Contributor

gs.action.getGlideURI().getMap().get('sysparm_view').toString() == ''; -->default view

gs.action.getGlideURI().getMap().get('sysparm_view').toString() == '*ViewName*';