Adding validation Code/Rule

Hello Every one

I have this challange where i have set my question called Observation with the name Observation and it requires one to enter values Greater than Zero and less or equal to 3, (i.e 1,2 or 3 only) the validation is already set and working.

However my next question now is related to my Observation question (where options are 0,1,2,and 3), where if one inputs 3 in observation question, values 3 or 2 or 1 or 0 can be selected from my selection list, if one inputs 1 in observation ( only 1 or 0 can be selected from my selection list.

I have tried to put the validation .<= ${Observation} in this second question but it only works when one inputs 3 in the first question. when 2 or is put in question Observation the rest of the selection doesn’t work

Welcome to the community, @mokech! Is this something you are looking for that has been discussed in the community before:

Hi @mokech, just to make the linked example relevant to your case, you can try something like this:

survey

type name label constraint relevant choice_filter
integer observation Observation . > 0 and . <= 3
select_multiple observations select_obs Select values ${observation} > 0 and ${observation} <= 3 name <= ${observation}

choices

list_name name label
observations 0 0
observations 1 1
observations 2 2
observations 3 3
1 Like

Thank You so much, This has worked, My label was not written well, i had to change to the numbers and is perfect.

2 Likes