Iam using dhis2 2.33.3 for tracker capture that is meant for android
I am trying to hide/show fields depending on a user selection. I would like to hide Qual método de PF data element if the user selects yes on A mãe está a fazer PF and also hide A mãe é utente de CBD if Options pilula or preservatvos is selected on Qual método de PF (which is an ption set).
I have created two program rules:
Hide data element Qual método de PF; This one works, but I get the error: Qual método de PF was blanked out and hidden by your last action
I have read the post you have directed me to, but what I want is to hide a data element based on the options selected from an option set. I want to hide A mae e utente de CBD if the options are not Pilula or Preservativos. The relational operator OR doesn’t seem to be working:
Try to separate your rules.
Make two separate rules with expressions like: d2:hasValue(‘Metodo_PF’) && #{Metodo_PF} hide Qual método de PF
Then do the next rule as d2:hasValue(‘preservation’) && #{preservation} hide A mãe é utente de CBD.
If the two are in different program stages, the dont assign trigger rule for program stage.
Both Qual método de PF and A mãe é utente de CBD .are in the same program stage. I can’t get things working after following your explanation. In the image below, The data element Qual método de PF has five options, and I want to hide the last data element A mãe é utente de CBD .if either Pilula or preservativos is selected.