How to get URL params in script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2018 11:56 PM
Hello,
i need to get URL parameter in script include.this script include will trigger by variables reference qualifier.
i didn't find the solution to get params in script include.Please help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2018 12:31 AM
The way to do this would depend on whether your script include is server or client side. Here's a quick article I found that should help:
http://sncommander.com/how-to-get-parametersvalues-from-a-url-in-servicenow/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2018 01:05 AM
Thank you for your reply,
i m using Script include server script.
i tried given doc syntax please check below,
- RP.getParameterValue('paramName')
for this RP is not defiened error coming.
2.gs.action.getGlideURI().toString()
for this i m getting "{sysparm_type=sp_ref_list_data}"
but actual values are "https://dev16236.service-now.com/sp?id=sc_cat_item&sys_id=0061c4274f105300b4787bb28110c736"
Please help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2018 01:22 AM
Off the top of my head I'm thinking that when you access gs.action.getGlideURI().toString() a script include triggered by a reference qualifier it doesn't have access to the page data yet as it has not been rendered. The full URL to the page is available client-side and the easiest way to access this on the server would be through the GlideAjax API, can you say specifically which parameter you are trying to access?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2018 01:29 AM
sys_id
this is my URL given below.
https://dev16236.service-now.com/sp?id=sc_cat_item&sys_id=0061c4274f105300b4787bb28110c736
how to pass these values from Reference qualifier is enough for me.please help me for this at least.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-09-2018 12:22 AM
Hi Adam,
if u dont mind ,Please explain how to get url params by glideAjax and how to pass from reference qual to script include.