How to hide option set before choosing yes or no

Hello,
I am using DHIS 2 version 2.38.1.1
In my tracker program am trying to hide the option set for reasons not giving a vaccine before either ticking yes or no , and show the option set only if i ticked No. I have looked into documentation and there are only those options:

thanks

@Haliz

I think the clarification here could be that you want to hide a field (specifically a data element) which as an option set assigned to it. That way the entire row will be removed until “No” is selected, and then would appear.

So for this, I would use “hide field”, and then hide BCG not given (same for other “not given” rows)

1 Like

Hi @Haliz.t ,

If you want to show the option set only after the user selects ‘No’, then you need to add the condition as follows

!d2:hasValue( #{variable} ) || #{variable}

The above condition will hide the option set if there is no value or “Yes” is selected (Inverse of when to show).

Thanks,
Rithvik

2 Likes

Thank you @rithvik and @Matthew_Boddie
@rithvik your suggestion works fantastically… very vey much appreciated.

1 Like