How to make a single line text to accept a only numbers and display custom message if string

avinashdubey103
Tera Guru

Hi , I have a requirement to make  a single line text to accept  only numbers and display custom message:

Quantity should be positive number and greater than 0.

I have used the regex but the it is showing this message :Not a number

 

1 ACCEPTED SOLUTION

You can find Regular expressions in "question_regex" table. You can create your own records and set the message.

Screenshot 2023-11-29 at 11.18.32 AM.png

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

5 REPLIES 5

Anil Lande
Kilo Patron

Hi,

You can create another regex(with same expression)  and add different message as per your requirement. Use newly created Regex in your variable configuration.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

@Anil Lande 
thanks for the reply , by creating regex you are asking to create client script or even can custom regex , please provide from where i can create it ?

You can find Regular expressions in "question_regex" table. You can create your own records and set the message.

Screenshot 2023-11-29 at 11.18.32 AM.png

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

shubhamdubey
Mega Sage

@avinashdubey103 

 

There is OOB functionality which validate the regex for the single line text variable.

For your reference i have attached the snapshot.Screenshot (44).pngScreenshot (45).png