Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to fetch URL details on the client side on Service Portal?

Community Alums
Not applicable

Hi,

 

I have written a onLoad() catalog client script to fetch a parameter from the URL. When I load the form on Service Portal, the below error is logged:

find_real_file.png

 

I have used below script-

var cartParm = getParameterValue('cart_edit');

function getParameterValue(name) {
var url = document.URL.parseQuery();
if (url[name]) {
return decodeURI(url[name]);
} else {
return;
}
}

 

An URL is https://xxxxxx.service-now.com/sp?id=sc_cat_item&sys_id=a8567775db0acf00d8da755a8c961918&cart_edit=6b9c66dadb6abf40ba197b5b8c9619e5

 

 

Any advise? Thanks!

1 ACCEPTED SOLUTION

senthilvaithees
Tera Guru
3 REPLIES 3

senthilvaithees
Tera Guru

Please refer this link

Community Alums
Not applicable

Hey!

Thanks!