Mapping Error on submission of form if the field mapped from variable is Encrypted

fathimasnow
Tera Contributor

We have a encrypted field on case table and we need to map that field with Record producer variable from map to field in the variable. After mapping we are getting error "Invalid attempt. Encrypted data could not be saved".

1 REPLY 1

Naveen20
ServiceNow Employee

Use the Record Producer's Script field. Remove the "Map to field" on that variable, and add this in the Record Producer's Script:

 
javascript
(function() {
    var encryptedValue = producer.variables.your_variable_name.toString();
    if (encryptedValue) {
        current.your_encrypted_field = encryptedValue;
    }
})();