We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

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

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

Not applicable

Hey!

Thanks!