- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 12:33 PM
How to set default password to a new user...when the user record inserted for the first time we need to set default password as "Sathwik@"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 11:36 PM
If you only want to set the default password for the users when you are loading in bulk then no need of Business rule.
you can handle this via onBefore transform script as well
Sample script below:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
target.user_password.setDisplayValue('Sathwik@');
})(source, map, log, target);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 02:28 PM
Hi Sathwik - Create a before business rule with insert checkbox set to true with script as
current.user_password.setDisplayValue("test123");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 10:21 PM
Hi
Thanks it worked, but I had a small query..Now I have tested for single user...If I imported bulk user records then the same business rule will work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 11:03 PM
If you want to update the default password for old users then try the script mentioned by
For setting default password for any user when new user is created you can use before insert BR without script option as suggested by
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 11:26 PM
P.S: When I tried the option without script i.e just using set field values it didn't work in my instance hence I have shared the script option.
Let me know if I have answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 11:39 PM