How to validate the field to allow only numbers,(comma).(dot) Please suggest if script is needed

Archana23
Tera Contributor

How to validate the field to allow only numbers,(comma).(dot)

Please suggest if script is needed

10 REPLIES 10

Could you please provide inputs that you want to accept?

It should accept comma, dot, numbers

After comma or dot it should accept only 2 digits

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @Archana23 

Is it a variable or field on the form..?

Were you able to achieve this from the below thread?

https://www.servicenow.com/community/virtual-agent-forum/how-to-make-a-variable-to-be-restricted-lik...

 

Please mark the answer as helpful and correct if helped. 

Kind Regards,

Ravi Chandra  

Ankur Bawiskar
Tera Patron
Tera Patron

@Archana23 

what RegEx did you start with? it should be an easy one

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

^\d+(,\d{1,2}|\.\d{1,2})?$

I was using this, not working as expected.