Defining program rules for multiselect questions in dhis2

Hi @Quoda

Great to see you posting, and thanks for the further clarification. Yes, you have clearly explained. I also need to search more and test on play. :pray:

Thanks!

Update:

@Quoda, I believe I found the answer to your question.

You can use d2:validatePattern to get the value from the multiselect option set. For example, d2:validatePattern(ProgramRuleVariable,'.*\\bAccra\\b.*') will look for the word in the string and if it’s true, it will return true.

Here’s a quick and short tutorial with more details:

I hope you like it! :grin:

Please mark as solved if it solves your question or feel free to ask for more details if it doesn’t work on your side.

Thank you!

4 Likes