Validating for empty string thru validation rule

Hi all,

Please note I would like to add a validation rule to check for empty values. For example, I want to validate like


But I am not able to add an empty string like “” on the “right side expression”.

Please assist.


You use the function d2:hasValue(‘name’) to check for non-empty values (or the same with ! in front to check for empty values).


1 Like

Hi @Calle_Hedberg,

Thanks for your reply.

Please note I am trying this validation under “validation rule”. This section of the app does not allow d2 functions. d2 functions are working under program rule but not allowed (may be I am wrong) here.

As you see I am getting a “Expression is not well-formed” error.

1 Like


Apologies, I misunderstood your inquiry there. And you are probably right, I’ve never seen Regex type expressions under validation rules.

Did you try “… IS NULL”?


1 Like

Thanks for the hint. I will try and update.

1 Like

Hi @MSP,

Was @Calle_Hedberg’s recommendation helpful?


Sorry I missed to update here. Nope, it did not work.

Did you manage to work around it?

To my understanding, validation rule will not help to achieve this. So we developed a procedure to achieve what we wanted.

1 Like