Auto generate Password by using First Name and last name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â10-12-2022 11:45 PM
Hi I have created a Catalog item where we have a Variable called First name, last name and password I want the password field to update with first two letters of the first name and last name and some random number between 0 to 1. I could see some business rules when record is inserted but can we achieve this by using client script or script include? we have any script for this.
Thanks in advance
Regards,
Sravani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â10-12-2022 11:48 PM
You can right same Business Rule login in your 'Script' field of Record Producer also.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â10-12-2022 11:59 PM
This can be achieved using an onChange client script on both the first name field and the last name field.
You need 2 onChange Client Script.
First one on the first name, where you need to check if both first name and last name is not empty then take 1st two characters using substring functionality and last 2 characters.
The 2nd client script should be on last name with the same checks
You can generate random number using logic mentioned in the below link
https://www.w3schools.com/js/js_random.asp
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â05-29-2024 01:57 PM - edited â06-02-2024 11:56 PM
Using your first and last name to generate a password might seem like a convenient idea, but it's not the safest practice. Personal information like your name can be easily guessed or found online, which could make your password vulnerable to hacking. It's always best to use a strong, unique password for each account. You can try using an password generator online to create a secure password that's hard to crack. These tools can generate complex passwords that include numbers, symbols, and uppercase and lowercase letters, making them much more secure than anything you could come up with using your name.