Aborting a form

I am aware that it is possible to abort a form and exit without saving by tapping the back button and tapping ‘EXIT WITHOUT SAVING’.

Is it possible to achieve the same result in response to a question in the form? For example, for a particular form it may be crucial to know the name of a child’s mother and if that’s not known the form is not valid or required. So you could make that the first question “Do you know the name of the child’s mother” and if the answer was “No” the form would exit and not ne saved.

Thanks

Simon

Hi Simon, I’m afraid that may not be possible at this time. You could possibly add a label question, mentioning something like: “this form is not valid, press the back button and exit without saving”, which would be displayed if the answer to the name of mother question would be “no”

Cheers,

Kishan

Thanks Kishan.

I am using the ‘label approach’ you suggest at the moment, I just wondered if I could ‘automate’ this. I have also thought of putting a display condition on all subsequent questions/question groups which would be tedious and have future support implications. I’ll see how we get on.

Regards

Simon
18/12/17

Hi Simon,

If you decide to go the route of adding a display condition, I would recommend moving all of your relevant questions inside a single group, and putting the display condition on the group as a whole. This way, if you ever need to add more questions to the form, you won’t have to remember to add the display condition. Also, if the display condition ever changes, you’ll only need to update the condition in one place: on the group question.

This will still be somewhat tedious, since you will need to update any case management to reference the new form question names, and you will need to make sure that any references to questions within the form are updated to point to the correct location (e.g. if you had a question #form/date_of_birth and you moved it into a question group called display_group, you would need to make sure all references to the question were updated to #form/display_group/date_of_birth). CommCare will try to do the latter automatically, but I’d still recommend going through the form and making sure the references look the way you expect.

Hi Simon,
I guess you can easily achieve that using the Choice field as you said, but please make the first question, “the name of the mother” required field.

Yaw

Thanks Cody.

Your advice is much appreciated.

Simon

Got it Yaw.

Thanks

Simon