To get URL Parameters using Jelly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 05:53 AM
Hi All,
I have the uRL as
The parameters in my Url are Tablename, sysid of the record.
I want to write a jelly script so as to achieve the below functionalities :-
1. How can I retrieve just the sysid from the above URL and convert the sysid to display value of the record.
2.How to set the value retrieved in 1st step to a custom field
Thanks
Surya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 05:59 AM
Hi Surya,
In your jelly, you can do RP.getParameterValue('sysparm_document_key'); to grab that url parameter value. You can then use it to get a gliderecord for your record.
Extensions to Jelly Syntax - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 06:04 AM
Hi Brad
<g:evaluate var="jvar_gr" object="true" jelly="true">
var gr = new GlideRecord("TestTable");
gr.get(jelly.sysparm_document_key);
gr;
</g:evaluate>
${sysparm_document_key}
It is yielding me tablename and sysid.
I am not able to just get the sysid out of there
Thanks
Surya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 06:08 AM
If you just want the sys_id, you could do this:
<j:set var="jvar_doc_id" value="${RP.getParameterValue('sysparm_document_key')}" />
${jvar_doc_id}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2016 06:17 AM
Hi Brad,
Its giving me a blank with this
<j:set var="jvar_doc_id" value="${RP.getParameterValue('sysparm_document_key')}" />
${jvar_doc_id}
Thanks
Surya