We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to take field value from only between 0 to 100 in servicenow

Sai Santhoshi
Tera Contributor

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

SunilKumar_P
Giga Sage

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