Encrypt a field on the RITM form containing sensitive variable: GlideEncrypter/Decrypter

 

Before insert business rule (on RITM)

 

(function executeRule(current, previous /*null when async*/ ) {

 

    var encr = new GlideEncrypter();

    var encrypted = current.variables.sensitive_data;

    var encrString = encr.encrypt(encrypted);

    current.u_encrypted_box = encrString;

   // gs.addInfoMessage('encrypted: ' + encrString);

 

})(current, previous);

 

 

Decrypter UI Action (on RITM)

 

gs.addInfoMessage('DECRYPTED: ' + new GlideEncrypter().decrypt(current.u_encrypted_box));

 

       //}

 

 

       action.setRedirectURL(current);

 

 

Reference:

 

https://developer.servicenow.com/print_page.do?release=Paris&category=null&identifier=GlideEncrypterAPI&module=api

 

Comments

Popular posts from this blog

GlideRecord setValue

URL link in addInfoMessage