Clearing out data points based on updated display conditions

Greetings all,
I’m building an ‘update’ form to enable mobile users to make changes to
cases.
I’m picturing a situation with a two-stage question such as “Do they
have a mobile phone?” if yes then “What is the mobile phone number?” In
the initial instance the answer was “yes” and then a number was entered. On
the update, the first answer is changed to ‘no.’ Therefore the second
question doesn’t get asked. My concern then, is that there is data sitting
in a case property which one might reasonably expect to actually be 'null.'
What have you done to address this is in the past? Do you assume that
the phone number won’t be used if the controlling case property is 'no?'
This seems somewhat reasonable, but not particularly robust. I’m leaning
towards adding a behind the scenes step in the update form which will set
the second value to ‘null’ if the display condition control gets set to
false. Has anyone else dealt with this?

Thanks,

Derek

Hey Derek,

If you have a display condition on a question and it is skipped, that
question won’t get saved to the case. So if you have your application
configured to save the “Mobile Phone Number” question to the case, but then
have display logic that skips the question, “Mobile Phone Number” won’t get
saved to the case if the question is skipped.

Sheel

··· On Wed, Jan 18, 2017 at 3:18 PM, Derek Lane wrote:

Greetings all,
I’m building an ‘update’ form to enable mobile users to make changes
to cases.
I’m picturing a situation with a two-stage question such as “Do they
have a mobile phone?” if yes then “What is the mobile phone number?” In
the initial instance the answer was “yes” and then a number was entered. On
the update, the first answer is changed to ‘no.’ Therefore the second
question doesn’t get asked. My concern then, is that there is data sitting
in a case property which one might reasonably expect to actually be 'null.'
What have you done to address this is in the past? Do you assume that
the phone number won’t be used if the controlling case property is 'no?'
This seems somewhat reasonable, but not particularly robust. I’m leaning
towards adding a behind the scenes step in the update form which will set
the second value to ‘null’ if the display condition control gets set to
false. Has anyone else dealt with this?

Thanks,

Derek


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah

So you’re correct in that you will have to add a hidden value that manually
sets the mobile phone number to “blank” if it already has a value but then
the user says that they do not have a mobile phone number.

··· On Wed, Jan 18, 2017 at 4:07 PM, Sheel Shah wrote:

Hey Derek,

If you have a display condition on a question and it is skipped, that
question won’t get saved to the case. So if you have your application
configured to save the “Mobile Phone Number” question to the case, but then
have display logic that skips the question, “Mobile Phone Number” won’t get
saved to the case if the question is skipped.

Sheel

On Wed, Jan 18, 2017 at 3:18 PM, Derek Lane dlane@dimagi.com wrote:

Greetings all,
I’m building an ‘update’ form to enable mobile users to make changes
to cases.
I’m picturing a situation with a two-stage question such as “Do they
have a mobile phone?” if yes then “What is the mobile phone number?” In
the initial instance the answer was “yes” and then a number was entered. On
the update, the first answer is changed to ‘no.’ Therefore the second
question doesn’t get asked. My concern then, is that there is data sitting
in a case property which one might reasonably expect to actually be 'null.‘
What have you done to address this is in the past? Do you assume
that the phone number won’t be used if the controlling case property is
’no?’ This seems somewhat reasonable, but not particularly robust. I’m
leaning towards adding a behind the scenes step in the update form which
will set the second value to ‘null’ if the display condition control gets
set to false. Has anyone else dealt with this?

Thanks,

Derek


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 <(781)%20428-5419> | skype: sheel_shah


Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah