Not making the question required while applying constrain



What is the problem? Please be detailed.
I have applied the calculate function in the previous variable, based on which if the answer will not match the constraint will be applied and it will restrict to proceed to next question until and unless the answer is corrected. So, is there any way to proceed to the next question just by showing the error message in such a mismatch case??
What ODK tool and version are you using? And on what device and operating system version?

What steps can we take to reproduce the problem?
Is there any solution or code to make it not required even the constraint is applied?

What you have you tried to fix the problem?
I tried keeping "no" in the required field but it didn't work.

Anything else we should know or have? If you have a test form or screenshots or logs, attach here.
Even though I tried placing no in the required attribute but also it restricts to proceed to the next question

(Mehrab Ali) #2

I am not entirely sure if I understood your problem correctly. But as a suggestion, if you insert a note field putting the error message in the label, with a relevance of mismatch of the two variables, solve your problem? You can make the note field required if you want the enumerator to go back to correct the values to proceed further.


Actually, the constraint is in "integer" question type and I wanted to detect the mismatch in the same question but after showing the error message it should allow proceeding in the next question. As per your suggestion, the "note" can be grouped or showed on a different page. But, I am looking for the message displaying in the specific question and allow to proceed to next without adding an extra question like note

(Ronald Munjoma) #4

Hi @Gajurelsub

This is what I usually do for the age field, I have a constraint with the required age range, any value outside the range is not accepted. I will also have a condition to bypass the constraint if the interviewee does not know their age.

In the below example: age should be equal to or greater than 16 and less than or equal to 100. Anything outside that range is not allowed and you can not proceed to the next question, but I also have a condition for unknown age of 999

(. >= 16 and .<=100) or .=999

Hope you can build on top this and come up with a solution.

If you describe your use case we might be in a better position to help.