ServiceNow - 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:
Comments
Post a Comment