We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to validate the field for Decimal values only in Catalog Item Variable?

VIKASM535239375
Kilo Sage

How to validate the field for Decimal values only in Catalog Item Variable?

1 ACCEPTED SOLUTION

Bhavya11
Kilo Patron

Hi @VIKASM535239375 ,

 

i have similar requirement at that time i have used this way to achieve this.

 

first step i have created the Question Regular Expressions [question_regex]

 

Bhavya11_0-1737716742129.png

 

after that i created the variable as single line text then in 'Type Specifications' section i have selected  Validations Regrex ,which  i created in first steps 

Bhavya11_1-1737716823618.png

 

 

 

Please try above solution.

 

 

Thanks,

BK

 

 

 

If this information proves useful, kindly mark it as helpful or accepted solution.

Thanks,
BK

View solution in original post

2 REPLIES 2

Bhavya11
Kilo Patron

Hi @VIKASM535239375 ,

 

i have similar requirement at that time i have used this way to achieve this.

 

first step i have created the Question Regular Expressions [question_regex]

 

Bhavya11_0-1737716742129.png

 

after that i created the variable as single line text then in 'Type Specifications' section i have selected  Validations Regrex ,which  i created in first steps 

Bhavya11_1-1737716823618.png

 

 

 

Please try above solution.

 

 

Thanks,

BK

 

 

 

If this information proves useful, kindly mark it as helpful or accepted solution.

Thanks,
BK

PritamG
Mega Guru

add ^\d+(\.\d+)?$ in the variable's Validation Script. Use Single Line Text or Number variable type. add an error message like