how to write a script for only alphabet letters using ServiceNow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 11:16 PM
The employee name should contain only alphabets and space and not more than 30 characters on the whole. |
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2022 12:10 AM
Hi, I Hope my solution helps you, if it helps please mark my response as correct and helpful so that it will be helpful for the future readers
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2022 10:01 AM
Hi,
You can achieve your requirement without scripting. please refer below doc

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2022 12:42 AM
Hi,
You can also have the regex validate the length, instead of changing the dictionary entry.
var regex = /^[a-zA-Z\s]{1,30}$/