- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 04:14 AM
Hi All,
I am looking for some help where the requirement is as follows:
1. New User should be created via catalog - This is done and working
2. Notification should be sent to user with a One time password and forcing them to reset the password momentarily while this OTP is entered.
Look forward for the help. TIA
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 03:22 PM
Hi
Is your issue resolved?
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:26 AM
BR condition is email is not empty.
Also, I am trying this in my PDI
There is a button available OOB to generate a password and it generates as
something like below
.X,o=Xg&]ic}bQWN{PTV=XZfd#_D,JT@4_[N=u.qDYHtVWs0>#z%aqxd%I^!aBsc:$3JD#j
and manual logging not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:56 AM
This is the encrypted version, I would suggest set the password manually, eventually it will be encrypted, don't worry about it, bring password field on the for, set password as Test@1234, and save the form, now try with userid and this password.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2022 05:14 AM
Hi Aman, I was able to update the script as below. The gs.log displays the actual password
I need help with taking this value from the log to notification. Can someone please help me how to get this value displayed there?
I am also attaching the notification script
template.print("1) Browse to https://" + gs.getProperty("instance_name") + ".service-now.com\n");
template.print("2) Enter your credentials\n");
template.print("User ID: "+current.user_name+"\n");
template.print("Password: "+current.user_password+"\n");
(function executeRule(current, previous /*null when async*/ ) {
//var randomstring = 'Snow@123';
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var string_length = 8;
var randomstring = '';
for (var j = 0; j < string_length; j++) {
var rnum = Math.floor(Math.random() * chars.length);
randomstring += chars.substring(rnum, rnum + 1);
}
gs.eventQueue("user.password", current, randomstring, current.email);
current.user_password.setDisplayValue(randomstring);
gs.log("pssw "+randomstring);
current.password_needs_reset = true;
current.update();
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2022 04:53 AM
Hi
You are almost there, you don't need to pass anything else to the notification:
template.print("1) Browse to https://" + gs.getProperty("instance_name") + ".service-now.com\n");
template.print("2) Enter your credentials\n");
template.print("User ID: "+current.user_name+"\n");
template.print("Password: "+event.parm1+"\n");// since you are already passing it in eventQueue function as
gs.eventQueue("user.password", current, randomstring, current.email);
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2022 03:22 PM
Hi
Is your issue resolved?
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar