How to get view name in UI Action script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 12:00 PM
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!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 12:07 PM
Hi,
Hope this helps.
https://community.servicenow.com/community?id=community_question&sys_id=bee343e5dbd8dbc01dcaf3231f9619aa
Thanks,Naveen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 01:03 PM
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
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2018 01:07 PM
Glad that helped you.
Thanks,Naveen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2024 01:23 AM
gs.action.getGlideURI().getMap().get('sysparm_view').toString() == ''; -->default view
gs.action.getGlideURI().getMap().get('sysparm_view').toString() == '*ViewName*';