Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

The number type type filed should only allows numeric value in Record producer variable?

Deepika61
Tera Contributor

Hi All,

Actually in Record Producer , i have some number type variables, i have given type as single line text, So my requirement was those variables should only allow numeric value, ?

Is there any possible to only one client script for all the variables to validate?

 

Please help me on this 

Thanks

Deepika

1 ACCEPTED SOLUTION

Not applicable

You might need to add the field to the form. It's OOTB Platform functionality, which is available for everyone.

 

PeterBodelier_0-1696489413027.png

 

View solution in original post

5 REPLIES 5

Not applicable

Hi @Deepika61,

 

On the type specifications tab of the variable, you can select which regex to validate. You can select Number there, to validate if only numbers are entered.

 

Hi @Community Alums 

Thanks for the response, but no luck, i was look for that but , its not available for me

Hi @Deepika61 

You can try for regular expressions "/^\d+$/" or you use isNaN() function in your client script to check for numbers

Not applicable

You might need to add the field to the form. It's OOTB Platform functionality, which is available for everyone.

 

PeterBodelier_0-1696489413027.png