Copy the 1way encrypted password from the user table

Modigari Anusha
Tera Contributor

Want to understand the how to copy 1 way encrypted password field to string field.

According to our requirement we have to share the userid and Password to the client We are using the below code to send the Userid and password.

Before Business rule

var pwdGenerationUtil = new PwdDefaultAutoGenPassword();
    var pwd = pwdGenerationUtil.generatePassword("");
    current.user_password.setDisplayValue(pwd);
    current.setValue('password_needs_reset', true);
    gs.eventQueue('survey.usr.email', current, pwd, current.email);
Now we are trying to send remainder email notification with same password and userid.
While trying to display the password feild it is not showing the value. So to use the encrypted we are trying to copy the field value from password to custom field. Both the passwords are showing with different values in xml
2 REPLIES 2

HrishabhKumar
Kilo Sage

Hi @Modigari Anusha ,

Check out this community thread: https://www.servicenow.com/community/developer-forum/how-to-copy-password-from-the-record-producer-o...

 

Thanks.

Hope it helps.

If my response turns useful mark it helpful and accept solution.

Modigari Anusha
Tera Contributor

I tried But still resulting Password in the email notification is different to the remainder email notification.