# Default behavior of skip logic in case of going back and editing response to a previous prompt

**URL:** <https://forum.odk-x.org/t/default-behavior-of-skip-logic-in-case-of-going-back-and-editing-response-to-a-previous-prompt/1790>\
**Category:** Support\
**Created:** [May 30, 2022, 5:51pm UTC](https://forum.odk-x.org/t/default-behavior-of-skip-logic-in-case-of-going-back-and-editing-response-to-a-previous-prompt/1790 "2022-05-30T17:51:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mandy\_Sin](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/mandy_sin/32/1016_2.png) [@Mandy\_Sin](https://forum.odk-x.org/u/Mandy_Sin)\
**Post date:** [May 30, 2022, 5:51pm UTC](https://forum.odk-x.org/t/default-behavior-of-skip-logic-in-case-of-going-back-and-editing-response-to-a-previous-prompt/1790/1 "2022-05-30T17:51:01Z")

</div>

I am facing a strange situation. In case of skip logic, if we make a mistake and go back to a previous prompt to change the response (resulting in to change of skip logic as well), the following prompts still stick to the original skip logic. This I think happens because the original (although incorrect) response to the following prompt is saved, due to which the skip logic flaws. To replicate the issue, use the sample form I am attaching. My test scenario: respond 1(yes) to q1, 1(yes) to q2 - this takes me to q3. Now, I realize that I responded incorrectly to q1. Now, if I go back to q1, correct it to 0(no), I should skip q2, q3 and q4 entirely and go directly to q5, however, I still get asked q3 (because I think the response to q2 is saved, causing the logic on q3 to take precedence over the logic to q2)

I feel like I am making some mistake because this shouldn’t happen as it is very common for an interviewer to make a wrong entry, and them going back to correct them. Is this how ODK-Survey supposed to work, or am I making some mistake somewhere?

[exampleForm.xlsx](https://forum.odk-x.org/uploads/short-url/e1rpJ3V84Yiyjau4jOC5qD5CCfL.xlsx) (16.9 KB)

---

<div class="post-metadata">

**Author:** ![elmps2018](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/elmps2018/32/105_2.png) [@elmps2018](https://forum.odk-x.org/u/elmps2018)\
**Post date:** [May 30, 2022, 6:25pm UTC](https://forum.odk-x.org/t/default-behavior-of-skip-logic-in-case-of-going-back-and-editing-response-to-a-previous-prompt/1790/2 "2022-05-30T18:25:40Z")

</div>

Hi @Mandy_Sin!

Given the skip logic you have written, ODK-X is behaving correctly. You had recorded 1 to q2 and the condition is if “data(‘q2’)==1” ask q3.

The way we have always handled this is to compound skip logic, e.g. “data(‘q1’)==1 && data(‘q2’)==1” is the correct skip pattern (and required, etc.).

---

<div class="post-metadata">

**Author:** ![Mandy\_Sin](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/mandy_sin/32/1016_2.png) [@Mandy\_Sin](https://forum.odk-x.org/u/Mandy_Sin)\
**Post date:** [May 30, 2022, 6:43pm UTC](https://forum.odk-x.org/t/default-behavior-of-skip-logic-in-case-of-going-back-and-editing-response-to-a-previous-prompt/1790/3 "2022-05-30T18:43:03Z")

</div>

Thanks @elmps2018  
Yes, I understand, but I recorded 1 to q2 incorrectly, and when I go back to q1 and record 0, the q2 should have skipped, hence no q3 as well. So it seems once I have made a selection for q2, it is not unset even when I go back to q1 and change the response to 0 (which actually should q2 irrelevant). Is that right? If yes, it there a way to unset/deselect a response to a select prompt?

---

<div class="post-metadata">

**Author:** ![elmps2018](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/elmps2018/32/105_2.png) [@elmps2018](https://forum.odk-x.org/u/elmps2018)\
**Post date:** [May 30, 2022, 7:00pm UTC](https://forum.odk-x.org/t/default-behavior-of-skip-logic-in-case-of-going-back-and-editing-response-to-a-previous-prompt/1790/4 "2022-05-30T19:00:59Z")

</div>

Hi @Mandy_Sin!

Per the skip you put in, q2 should have been skipped, but q3 should not have been skipped, because q2===1. Only if you compound the skip pattern would it then get skipped. Selections are not unset when you go backwards. Especially since folks often use ODK-X non-linearly, and the program doesn’t know what is an incorrect code. I don’t think there is a way to deselect, but you can compound skips, or you can assign to null if… (e.g. if q1 is a certain value). If you just want to make sure the enumerators don’t see the wrong questions, compounding the skips per my earlier post is earlier; if you want the data value to be removed on the tablet (rather than in post-processing) you’ll want to do the assign.
