How to convert a password data type to Plain Text or String Data type through scripting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-26-2022 06:37 AM
Scenario: As soon as new user record [sys_user] is created then send notification to newly created user with his UserID and password?
I tried by using:
step1) Create a event registry
step2) Calling event in after insert Business rule
step 3) Create a Notification
After previewing the notification it shows the same password as I have put in password field while creating new user.
ISSUE: But when actual notification is sent then it contain password is 24 character encrypted key.
I tried using toString() Method but it won't works.
So How Can we convert password datatype to String data type?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-26-2022 06:55 AM
Quite interesting issue. If you are able to see password in ServiceNow emails then it should also be visible same in outlook. However, could you please try assigning that password to another variable and then include variable in notification.
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-26-2022 06:57 AM
Hi,
You can GlideEncrypter() APi to decrypt password before sending it over to notification email.
Please read this nice article for details: https://davidmac.pro/posts/2020-12-24-sn-encrypt-decrypt/
Please note, you might need to do decryption twice/thrice if password is 24 encrypted characters.
Mark helpful/correct, if applicable.
Regards,
Muhammad
Muhammad