How to take field value from only between 0 to 100 in servicenow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 02:04 AM
I have a field in the table, how to make that field only accept values from 0 to 100(whole numbers) in servicenow
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2024 05:57 AM
Hi @Sai Santhoshi, You can try with regular expression somwthing like below.
var regex = /^(100|\d{1,2})$/;
var number = 12;
if (regex.test(testString)) {
// Allow the value
} else {
//Clear the value
}
Regards,
Sunil