Hide question if previously answered

Hello! I’m having issues with hiding questions if they were previously answered.
See screenshots below of how I set it up:


The question doesn’t hide after. This is happening in all my questions where I’m trying to hide if answered.

Any ideas?

Thank you.

Thanks @Clara! I will write a couple of suggestions by priority and hope that we will be able to find the solution. Please first use the browser cache cleaner app to clean all the cache, and I’d also use the data administration app > Maintenance to “clear application cache” and “reload apps”.

If it’s still not working then please make some tests with the rule you created. Would you like to try and see if each one of these conditions work on it’s own.

If none of the conditions work separately then maybe use the program rule condition as it is, and then we’ll definitely have to check the logs to know what’s the issue.

Thank you! (:

@Clara I would imagine problem is that it would put itself on a loop. Hiding a Data Element (at least in the event model) removes the value. So your program rule would get triggered and then un-triggered once the value was removed in the process of hiding it.

Other than that, I know that in newer versions (>=2.35, I believe) you can’t have a field be mandatory as well as hidden. Possibly that is in play here as well?

2 Likes

Very important point @Matthew_Boddie! :smiley: Could never have thought about mandatory yet hidden. (:

So I ended up realizing that DHIS2 only treats a data element as from a previous event if it’s the next day. If you submit the event form twice in the same day, it ignores this. Don’t know if we should raise a Jira issue on this @Matthew_Boddie @Gassim

1 Like

@Clara this sounds like it could be quite distinct from the above conversation. Perhaps you can create a new card and explain what you’re trying to accomplish? Or help me understand why this is pertinent to the above notes on prules within a single event

@Clara as @Matthew_Boddie suggested it might help if you create a new topic with steps to reproduce on play :pray: