Cover variable that shows which YES/NO multiselect question has missing answers


In my surveys I always find one or two of missing yes/no boxes ticked in my YES/NO multiselect questions at the end of the day when data checking. I have included static warning text below each question that disappears when all answers are given, but it still happens sometimes. I thought of building a variable on the cover screen that lets supervisors in the field see whether there are missings in the questionnaire before they upload the interview. (In my set up, supervisors reopen interviews, check for completeness and complete again, but one missing yes/no option does not show up as a missed question on the complete screen, so they would have to check each question to spot this).

I built this Boolean variable that works but it doesn’t show the supervisor (or enumerator) in which question there are missings. I could create more than one variable, but as there are 6 yes/no questions, I don’t want to clog the cover.

own.Missing.Length!=0 || trans.Missing.Length!=0 || crop.Missing.Length!=0 || livest.Missing.Length!=0 || ill.Missing.Length!=0 || child_inf.Missing.Length!=0

I imagine there must be a way to do this so that the cover variable doesn’t just show TRUE/FALSE, but shows the question name (or a string identifying the question, e.g., “assets”, “transport”, “livestock”) that has missings and “None//False” when not missing. But I know this is beyond my skills. Is there anyone who has done something like this before or has a suggestion how to accomplish it?

Many thanks for any help!


Hello @sebastiaanhesss ,

try something like:

(own.Missing.Length!=0) ? "assets " : "" + 
(trans.Missing.Length!=0) ? "transport " : "" + 
(livest.Missing.Length!=0) ? "livestock " : ""

This will show the names (as a space-delimited list) of the questions where there are unselected Y/N items. If you include this variable to the dashboard it should be visible to the supervisor and even the interviewer himself.

Best, Sergiy

Although I think @sergiy’s answer is the the best approach, you might also consider adding a validation condition to each of the Yes/No questions.

A validation such as self.Missing.Length == 0 on each of the questions will trigger an error immediately after the first response to the question, and will disappear once all Yes/No items have a response. A benefit of this is that the triggered errors are visible anywhere in the system where errors are visible, such as the summary page of the questionnaire, in the Supervisor filters, etc.

Yes, and Sebastian has written in his original post that he has

which should be the same syntax condition, but not as severe as to be counted as an error.

Looking at the situation, perhaps it is important to look at the real reasons why the items were not checked. It could be a real problem and the way the questionnaire is designed should be compatible with the requirement to have all items marked as either YES or NO specifically. Keep in mind that this question is exactly what makes it explicit that the respondent could not answer conclusively (compared to a simple multiselect question with checkboxes).

Typical situations (which are commonly inspired by the common approach where ‘own’ stands in for ‘use’):

  • I don’t know what a coffee maker is, so can’t answer if I have it.
  • I do have a TV, but it “doesn’t work”, so I don’t know if I should pick YES or NO.
  • I do have a radio, but it only works in the range of frequencies where no station is broadcasting since 1987, so does it count if I have a radio?
  • We do own a car, which was inherited from our grandfather, but nobody has a driver’s license to use it.
  • We do have a computer, but we don’t know how to operate it. So we use it as a paperweight.
  • I don’t know if my husband owns that laptop. He uses it for work, so it might belong to his employer. My husband is not available now.

Suppose your instructions to interviewers are perfectly clear about these situations, but there will be 100s of others. So having the interview not accepted simply because of the item not being checked as a YES or NO is a bit too strict in most cases.

In the case when you DO REQUIRE 100% that these questions are answered fully, perhaps a simple API assistant could do the job to automatically reject these interviews to the interviewers adding a comment on what needs to be worked on.

In which ones?

Best, Sergiy

1 Like

Thank you very much Sergiy and Giansib!

I’ll try building your code in today Sergiy.

I avoided the stricter validation condition, because I didn’t want the screen to flash red before an actual error occurs, so that this remains a psychological trigger for real errors.

I’ve had this issue in all my surveys, Sergiy, and I think it is mostly due to real errors rather than for the valid reasons you give examples of. I’ve always asked and highlighted these missings to the enumerators and never had a comment back similar to your examples. I think that despite instructions, enumerators sometimes skip NOs in the beginning of surveys and some are just oversights. That is at least how I always interpreted them (as said, I always ask). But having the general variable on the dashboard already prevented any missings in yesterday’s data, so finally found a solution that will be even better after I apply with your code.

Still better would be if you could enter such a variable to the Complete screen, so enumerators see it immediately before finishing an interview, but I don’t know if that is possible. Having the Dashboard is already a great improvement (compared to before that was possible).

Another option that may prevent (real) errors/mistakes is for each item box to slightly change shading once it has been answered, so it is visually clearer to the enumerator that they missed one. In a longer list and on a small screen one missing answer can be overlooked, I find. I don’t know if that is something that could be done/is desirable.



Dear Sergiy,

If I try your suggestion:

I get the error "Cannot implicitly convert type ‘string’ to ‘bool?’

I played around a little bit with the code, but couldn’t find a solution, also do not really understand which ‘string’ we are trying to convert.

Anything I’m not getting right?

Thank you again,


Hi Sebastiaan,

I think the + operator might be converting the expression directly after it (trans.Missing.Length!=0) to string before it is used by the ternary bool operators, which triggers the type error. I am not sure, however.

I tried this solution using string.Concat() and it works:

string.Concat((own.Missing.Length!=0) ? "assets " : "", 
(trans.Missing.Length!=0) ? "transport " : "", 
(livest.Missing.Length!=0) ? "livestock " : "")

Hi, @sebastiaanhesss ,

use Gian’s advice with the string.Concat() function , or turn this

into this:

((own.Missing.Length!=0) ? "assets " : "") + 
((trans.Missing.Length!=0) ? "transport " : "") + 
((livest.Missing.Length!=0) ? "livestock " : "")

to explicitly indicate the evaluation order with parentheses.

Best, Sergiy

Hi @sergiy,

Adding the parentheses still triggers the same error in the Designer.

I tried a simpler example: "" + ((own.Missing.Length!=0) ? "assets " : "")

and we still get the error “Cannot implicitly convert type ‘string’ to ‘bool?’”.

I believe this is a valid expression in C#, so perhaps this is a bug in the Designer’s evaluation?

Probably the problem is in the variable type - the result of the expression is string as desired, but the variable type is the default boolean type, hence the message. Just tried and the following compiles fine:

where hhhhh is a multiselect question.

Best, Sergiy


You are right, I created a new variable to test the solution with parentheses and forgot to change the type to string. The solution with parentheses does work.

Thanks again Sergei and Giansib for your help!

I woke up during the night thinking, ah, the variable has to be set to string of course, but then wouldn’t have known how to solve it using the parentheses, so would have still been stuck.

I’ve changed slightly to this, as the crops question is only enabled if the household worked any land last season:

(own.Missing.Length!=0 ? "Q28_own_assets / " : " ") + 
(trans.Missing.Length!=0 ? "Q47_own_transport / " : " ") + 
((crop.Missing.Length!=0 && land==1) ? "Q57_crops_grown / " : " ") +
(livest.Missing.Length!=0 ? "Q77_livestock / " : " ") +
(ill.Missing.Length!=0 ? "Q138_illnesses / " : " ") +
(child_inf.Missing.Length!=0 ? "Q154_factors_children " : "")

The && land==1 bit prevents the question showing as having missings if it is not enabled. (I did without the extra set of parentheses, but just moving the closing one to the end by mistake when coping your suggestion Sergei, but it seems to work fine too).

Thanks again for your help! Very pleased to be able to add this variable like this.


Very good and thank you for confirming!

For those playing along at home, here is an exercise:

The above code produces a properly delimited list if the last question child_inf is not answered fully, for example: Q28_own_assets / Q154_factors_children, but in other cases the list will not be properly delimited (with an extra delimiter at the end if the list is not empty): Q28_own_assets / Q77_livestock /. Consider modifying the above code to produce a properly delimited list in all cases.

Best, Sergiy