Friday, July 13, 2018

Get URL Parameters in a ServiceNow Client Script & Catalog Client Script

Create a onload client script



function onLoad() {
    var emp_sys_id = getParmVal('sysparm_emp_sys_id');
}


function getParmVal(name) {
    // get the current URL
    var url = document.URL.parseQuery();

    // decode the URL
    if (url[name]) {
        return decodeURI(url[name]);
    } else {
        return;
    }
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.