- 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: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:53 AM
just checked. doesnt seem to work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 04:08 AM
i tried the following code. do i need to make any more changes?
<?xml version="1.0" encoding="UTF-8"?>
<j:jelly trim="false" xmlns:g="glide" xmlns:g2="null" xmlns:j="jelly:core"
xmlns:j2="null">
<g:evaluate var="jvar_sys" jelly="true" object="true">
var sysparm_id = gs.action.getGlideURI().getMap().get('sys_id');
sysparm_id;
</g:evaluate>
<g:evaluate var="jvar_sys1" jelly="true" object="true">
var sysparm_id1 = '$[sys_id]';
sysparm_id1;
</g:evaluate>
<span>${jvar_sys}</span>
<span>${jvar_sys1}</span>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 04:15 AM
it works! thank you !