Filter logic for multiple choice questions using cases as choices

In a current form, I have two multiple choice questions (checkbox lookup
tables) that have cases as choices. I want the second question to only
display the case choices that were not selected in the first question. Is
it possible to do this using the Logic in the second question?

Thank you!
Lexa

I could be wrong but I don’t think that’s possible though maybe something
like this would work (but would likely require some custom expressions):

  • full_case_list = “case1 case2 case3”
  • cases_selected = “case1 case2”
  • regex = replace(cases_selected, ’ ', ‘|’) # replace spaces with '|'
    to create regex OR
  • filtered_list = replace(full_case_list, regex, ‘’)

Use “filtered_list” as the source for the datasource.

··· On 12 May 2016 at 11:44, wrote:

In a current form, I have two multiple choice questions (checkbox lookup
tables) that have cases as choices. I want the second question to only
display the case choices that were not selected in the first question.
Is it possible to do this using the Logic in the second question?

Thank you!
Lexa


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Simon Kelly
Senior Engineer | Dimagi South Africa