- 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:20 AM
@rad
this should work fine
<g:evaluate var="jvar_sys" jelly="true" object="true">
var sysparm_id = '$[sys_target]';
sysparm_id;
</g:evaluate>
<span>${jvar_sys}</span>
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:28 AM
Hello, Tried this and it still doesnt work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:37 AM
Hi,
are you sending the correct url parameter name and value
how are you calling the UI page
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:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2021 03:40 AM
It works for sys_id. but when i try for other parameters like sys_target. it doesnt work.
im checking the attachments UI page