ServiceNow - Encrypt a field on the RITM form containing sensitive variable: GlideEncrypter/Decrypter
Import
·
Mar 24, 2022
·
article
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:
View original source
http://www.cloudminus89.com/2022/03/encrypt-field-on-ritm-form-containing.html