How to get URL params in script include

anjaneyulumuvva
Kilo Expert

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.

14 REPLIES 14

Community Alums
Not applicable

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/

 

Thank you for your reply,

i m using Script include server script.

i tried given doc syntax please check below,

 

  1. 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.

 

Community Alums
Not applicable

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?

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.

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.