Get bits from the URL

get entire url:

var instanceURL = GlideTransaction.get().getRequest().getHeader("referer");


get bit of a url:


var surl='https://glddev.service-now.com/hr/case_detail.do?sysparm_case=210ebaf74f82ef00aaa42c518110c7a9&sysparm_newcase=true&sysparm_nameofstack=250efaf74f82ef00aaa42c518110c705';
//--bit between 'sysparm_newcase' and '&'
var testRE = surl.match("sysparm_newcase=(.*)&");
gs.print(testRE);

Comments

Popular posts from this blog

Running transform maps asynchronously

Post a command to the ECC queue for the mid server to initiate a powershell file copy

GlideRecord setValue