How to perform Regular Expression Check (JSU) only when field is not empty

Preeti Yadav August 8, 2022

Hello,

I have a custom field called Digit in create screen. Requirement is to check if field is having only 10 digits in it. For that I have used Regular Expression Check (JSU).

But it is also checking the validations when field is empty. I need that when field is empty nothing to be checked and when it has value need to check if its having only 10 digits or not.

1 answer

1 accepted

1 vote
Answer accepted
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 8, 2022

Isn't the regex extended, in a sense you could do

^([0-9]{10}|)$

Where the | pipe serves as "or". I haven't tested above but I remember I set up a couple of those before. 

Preeti Yadav August 8, 2022

Hi @Radek Dostál ,

Thanks! It worked.

Regards,

Preeti Yadav

Suggest an answer

Log in or Sign up to answer