I have not actually tried whether this works in practice, but maybe you can add the different options from an option set into two different option groups - so A and C in one option group and B and D in another. Then, you could create a program rule with the program rule action âHide option groupâ which triggers for example based on the userâs user role - d2:hasUserRole. Then the user should only see the options that are not in the hidden option group.
Let me know if you get the chance to test out whether that works!
We can test it out on play.dhis2.org@kstankevitz! Thank you for your question! Iâll give it a try on play too. Feel free to post if you get to it before I do.
I actually got this working- apologies for not posting an update sooner. It worked just as Karoline described, with the below action/expression in the program rules.
expression: d2:hasUserRole(âxxxxxxxxxxâ)
action: hide option groups