Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to allow numbers and decimals in string

pramodkumar
Tera Expert

Hi All,

How can we create regex to allow numbers and decimals in string variable.

For ex: 1234, 12334.89

 

 

Thanks!

5 REPLIES 5

RaghavSh
Mega Patron

There is already a regex in service now OOB instance for this, you just need to use that.

 

Refer :https://www.servicenow.com/community/developer-forum/how-to-make-a-variable-in-catalog-form-to-accep... 


Raghav
MVP 2023
LinkedIn

@pramodkumar Did you get your issue fixed?


Raghav
MVP 2023
LinkedIn

@pramodkumar did this work for you?


Raghav
MVP 2023
LinkedIn

Vishal Birajdar
Giga Sage

Hi @pramodkumar 

 

You can create regex as below screenshot. 

 

VishalBirajdar_0-1697458358150.png

 

and use that regex in single line text variable :

 

VishalBirajdar_1-1697458422605.png

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates