Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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