Using program rules with multi-select option sets to show conditional fields

Question:
After using a multi-select checkbox (option set), can program rules
detect selected values and show specific data elements (e.g. Qty Maize, Qty Beans)?

Which DHIS2 version supports this?

Example:
If user selects:
:check_box_with_check: Maize
:check_box_with_check: Beans

Then show:

  • Qty Maize
  • Qty Beans

Hi @scelo

Welcome back to the DHIS2 Community of Practice! :slight_smile: Your post is interesting, sounds like a project in the agriculture sector? :grin:

Yes, what version of DHIS2 are you using?

If you are in version 42+ you can use:

d2:containsItems(#{CropsSelected}, 'BEANS')

If you are in a previous version, please check out this suggested solution: Defining program rules for multiselect questions in dhis2 - #3 by Gassim

Hi @Gassim,

I’m using version 2.41.7. Perhaps it’s not in this version as you have mentioned above. Is there a documentation that shows how the analysis work in case I do an upgrade? Otherwise I guess I will stick with the current version and do (yes/No for all the choices as dataElements).

It’s actually a project looking at NCPs for children and there all sectors involved e.g. Health, Construction, Agriculture, Education, etc

Please share any resources that may help.

Thanks

If you’re considering an upgrade to a higher verison please see the release notes in release

The link I shared should work for your version.