Clear relevant answers if previous question is changed

Hello All,

I have several groups which are relevant based on a upfront yes/no question. If the enumerators initially select yes and continue they can enter answers, but if they need to go back to change the yes/no choice to no the data in the following questions remain, and they would need to delete this manually (or on the downloaded dataset).

Is there a method to automatically clear the following relevant answers if the Yes/No is changed from Yes to No?

I am using xlsforms.


Are you sure you're using an ODK tool? Please let us know the tool and the version.

Both ODK Collect and the Enketo web form engine clear non-relevant values on submission. Enketo does use the values during form filling which is a discrepancy we're working to address: Feedback needed: Enketo relevance change to align with ODK Collect

You want to clear relevant answers? Can you give an example of what you have in mind? Typically a follow-up that's supposed to be blank if the original answer changes can/should be made non-relevant.

What I regularly see is the need to clear a relevant follow-up question to force that it gets reconsidered and filled out again. You can do this using a dynamic default based on value changes. See this documentation.

Hi, I am using the latest version of odk collect, 2022.2.2 and kobotoolbox. Sorry I have not looked at the downloaded data but only on the tablet and see that the data remains if the change the answer I.e change from yes to no, and then change back to yes and check the fields contain the previous input data. If these are removed on submission to the server that is fine. Is that correct?

The question goes like this:

Did you catch fish? Yes/No

Begin group (relevant if yes)
What type of fish?
How many?
End group

I need the values in the group to be cleared if the answer of the first question is changed from yes to no.

Those questions will not be part of the submission so you will not see them on the server.

They are saved by Collect in case the relevance change was accidental. This ensures that a data collector does not lose potentially many answers if they toggle a question that controls the relevance of others.

1 Like