Required question depends previous question

Hi @clarice_larson, @elmps2018 and all, I am developing a demographic survey form using ODK2.0. The first section of the survey is a consent section. If the respondent is not eligible, the data collector should choose refuse then end the survey and tab on finalize button.
When tabs to finalize button, it asks to fill up other question too not matter it has required = TRUE or FALSE.
Could anyone please help me.
Thanks.

Hi @nsthakuri,

It sounds like the if-else condition may be incorrect. Or do you have a constraint that is not being met? If you could send an example, that would be helpful.

Thanks,
Clarice

Thanks.
The first question is consent. If respondent would refuse, we don’t need to fill up other questions. We could jump to next button and press the finalize button. When we tab the finalize button it says to complete required field because I put required = TRUE. My concern is that is it possible to skip the required field when skip pattern is there. But it allows to save if we tab to incomplete tab.
demogForm.xlsx (18.8 KB)

Hi @nsthakuri!

So you need to line up your required with your skip patterns (even when you have a finalize). We actually often used excel functionality to set the required equal to the condition for the if. So if the condition is C3, you can set the required =C3 (e.g. type =C3 in your cell T5). So set the required, in your case, as:
selected(data(‘consent’), ‘“1”’)
instead of TRUE

Best,
Caroline

Thanks @elmps2018,
We set the required equal to the condition of excel functionality which is helpful.
Thanks,

A post was split to a new topic: Error when setting constraint