I would like to create a validation rule for yes/no value-type of dataelement which should force the user to fill a number field if the answer is YES to a data element in a dataset". If the answer is No, then the user should not fill the number field.
Hey @dmbantu,
As it explains in the documentation, " The Compulsory pair operator allows to require that data values must be entered for a form for both left and right sides of the expression, or for neither side. This means that you can require that if one field in a form is filled, then one or more other fields must also be filled." Home - DHIS2 Documentation
So maybe change it to a check mark for the yes without a no because what you have here in the compulsory pair is that it’s either both are null or both are non-null; therefore, if user presses yes they must fill out the other question but if they don’t press anything i.e. null then the other question can remain null. I hope this helps! (:
I have changed the DE to a check mark, but no validation error is displayed if I either press the check mark or enter a number in the second data element and click the complete button.