- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:00 AM
Hello,
I am trying to get parameter from the URL in UI pages.
URL - https://xxxxxx.service-now.com/incident.do?sys_id=-1&sys_is_list=true&sys_is_related_list=true&sys_target=incident
I have tried the below code
<g:evaluate var="jvar_sys">
var sysparm_id = RP.getParameterValue("sys_target") + "";
sysparm_id;
</g:evaluate>
<span>${jvar_sys}</span>
This works when i try to get sys_id but returns blank when used for sys_target
Is there any way to get it work for other parameters?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:48 AM
Hi,
then this should work fine
<g:evaluate var="jvar_sys" jelly="true" object="true">
var sysparm_id = gs.action.getGlideURI().getMap().get('sys_target');
sysparm_id;
</g:evaluate>
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:15 AM
Can you try through GlideURL?
action.getURLParameter('sysparm_query');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:34 AM
I think this works for UI actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 04:16 AM
i was wrong 🙂
getGlideURI()
worked

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:16 AM