3.3.1 (latest version as of Feb 2026) Android---Hiding (last) data element in Android with program rules

In 3.3.1 we are experiencing an issue where a DE is not being hidden despite program rule actions commanding it to do so when prior DE is set to “No”. The full functionality should be:
if DE 1 is Yes, Make DE 2 mandatory
If DE 1 is No, Hide DE 2

This worked fine in 2.8.2 and 2.9.1.1 and works presently in v40.10 capture, but on 3.3.1 the DE2 remains visible. Strangely, when I select an option within the DE2, if DE1 is set to “No”, the value immediately gets removed. if DE1 is set to “Yes”, the value remains. I have checked to ensure there are only 2 programRuleActions assigned to DE2, 1 for makeMandatory and 1 for hiding.

Is this ringing any bells at all? In other places I’m able to hide and make data elements mandatory based on program rules; is there something with DEs with optionSets or DEs being last in visible order on Android that is currently problematic?

Hi @Matthew_Boddie
If I understand correctly here

  1. DE2 is expected to be hidden when DE1 is set to no, but it’s not being hidden.
  2. DE2’s value gets removed or it gets hidden (which one is it value itself removed or DE2 hidden?), when an option is selected from DE2 (which is not supposed to happen because DE2 is supposed to already be remove)??

Is DE1 ‘Yes’ by default? Maybe that’s triggering the rule to make DE2 mandatory and once it is set to mandatory it can’t be hidden.

Thanks for response @Gassim ! DE1 has no default settings; indeed I was thinking the d2:hasValue() pieces that I originally had in my prule conditions might have been gumming up the process. seems this is happening with or without that nuance, however. I’ve also used an existing prule which successfully hides other DEs from another DE’s response (also a Yes/No DE), and I get the same reaction (not hidden, but responses are wiped away when I select one if the prule is “active”)

Anyway. I hear that this sounds complicated, will have to try and replicate on 40 play with the 3.3.1 android and go from there.

1 Like

Just an update, pretty fascinating. Imported the entire program into 40.11 and it worked fine on play with 3.3.1. I can’t reconcile why its working with 40.11 and not with 40.10, but clearly something is going on. So I’m changing my question in a question on investigation:

What could make android behave in a way whereby:
Prule 1: Makes a DE mandatory
Prule 2: Hides a DE

When Prule 2 should be active, I am able to see but not enter a response (the option is removed when I select it). When Prule 1 is active, nothing happens (its not mandatory).

1 Like

that’s great news! I think it’s as @vgarciabnz predicted that these were issues in v.10.

:grin: Sure, let’s investigate! :man_detective:

You mean when both program rules are active? Does it work as expected when one program rule alone is active? Is this for the same data element?

They should be mutually exclusive. (i.e. one is triggered when a DE is true, the other when false). I’m seeing some difference when Prule 2 is active (can’t keep an option selected, although it doesn’t hide it), but not when Prule 1 is active (no * exists and no warning or prevention of saving when it should be mandatory and has no value).