- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 02:57 AM
Developing a new site using ServiceNow CMS and need to access the URL value inside jelly code. I see that window.location method does not work inside j or g tag in jelly instead in script tag.
Can someone please explain how to access URL value inside jelly tags?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2014 02:24 AM
This piece of code seems to work fine on a demo instance:
<g:evaluate var="jvar_site_and_page" jelly="true">
var page = new GlideRecord('content_page');
page.get('${RP.getParameterValue('sysparm_sys_id')}');
page.content_site.url_suffix + '/' + page.url_suffix;
</g:evaluate>
Current URL is this:<br/>
${RP.getParameterValue('jvar_base_uri')}${jvar_site_and_page}.do
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2015 09:57 AM
Hi Alex,
You are right. Thanks for pointing this out!
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 09:43 AM
The ServiceNow Wiki content is no longer supported. Updated information about this topic is located here: Extensions to Jelly Syntax
Visit http://docs.servicenow.com for the latest product documentation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2015 06:41 AM
If you just need the URL suffix of the current page you can also do something like:
<g:evaluate>
current_page.getURLSuffix();
</g:evaluate>
You can also take a look here for further methods of the current_page object: current_page Object Type Confusion
With current_page.getSiteID() you should then also be able to query the url_suffix of the content_site table if that is necessary.