# Overwriting case property with missing value

**URL:** <https://forum.dimagi.com/t/overwriting-case-property-with-missing-value/2606>\
**Category:** Users\
**Created:** [February 19, 2016, 5:31am UTC](https://forum.dimagi.com/t/overwriting-case-property-with-missing-value/2606 "2016-02-19T05:31:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Berry](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/simon_berry/32/492_2.png) [@Simon\_Berry](https://forum.dimagi.com/u/Simon_Berry)\
**Post date:** [February 19, 2016, 5:31am UTC](https://forum.dimagi.com/t/overwriting-case-property-with-missing-value/2606/1 "2016-02-19T05:31:24Z")

</div>

In our application cases are retailers and we have forms for putting  
retailers on the system and editing them.

In addition we have a visit form which gathers data when a retailer is  
visited.

I am updating the visit form so that it checks for key missing data from  
the case and, if data is missing from the case (eg retailer GPS location,  
retailer gender etc), it requests it at the end of the normal visit form.

I'm doing this using hidden values which load the current value of the  
property (which may or may not be missing) from the case. Then the visit  
form has "additional questions" with display conditions on them so that  
they are only displayed (ie asked) if the hidden value is '' or '---'.

Then, at the end of the visit form the values of the "additional questions"  
are saved to the case.

My question is:

1. If the "additional questions" (eg the retailer location) are not  
asked (because they are already known) what gets saved back to the case  
when the visit form is submitted? I'm concerned that a missing value might  
get saved back to the case and overwrite a known value. Although I could  
test this, I don't want to submit 'test' visit forms as there is no way of  
deleting them later and this will complicate analyses we do on this data in  
the future.

Thanks

Simon

---

<div class="post-metadata">

**Author:** ![William\_Pride](https://dimagi.b-cdn.net/letter_avatar_proxy/v4/letter/w/b19c9b/32.png) [@William\_Pride](https://forum.dimagi.com/u/William_Pride)\
**Post date:** [February 19, 2016, 2:11pm UTC](https://forum.dimagi.com/t/overwriting-case-property-with-missing-value/2606/2 "2016-02-19T14:11:06Z")

</div>

Simon,

By default no not-displayed questions will be saved to the case. If the  
display condition of a question is false then that node will (in XForm's  
view) not exist and so the bind setting the case property to that value  
will not fire.

Best,  
Will

> **···**
>
> On Fri, Feb 19, 2016 at 12:31 AM, Simon Berry wrote:
> 
> > In our application cases are retailers and we have forms for putting  
> > retailers on the system and editing them.
> > 
> > In addition we have a visit form which gathers data when a retailer is  
> > visited.
> > 
> > I am updating the visit form so that it checks for key missing data from  
> > the case and, if data is missing from the case (eg retailer GPS location,  
> > retailer gender etc), it requests it at the end of the normal visit form.
> > 
> > I'm doing this using hidden values which load the current value of the  
> > property (which may or may not be missing) from the case. Then the visit  
> > form has "additional questions" with display conditions on them so that  
> > they are only displayed (ie asked) if the hidden value is '' or '---'.
> > 
> > Then, at the end of the visit form the values of the "additional  
> > questions" are saved to the case.
> > 
> > My question is:
> > 
> > 1. If the "additional questions" (eg the retailer location) are not  
> > asked (because they are already known) what gets saved back to the case  
> > when the visit form is submitted? I'm concerned that a missing value might  
> > get saved back to the case and overwrite a known value. Although I could  
> > test this, I don't want to submit 'test' visit forms as there is no way of  
> > deleting them later and this will complicate analyses we do on this data in  
> > the future.
> > 
> > Thanks
> > 
> > Simon
> > 
> > --  
> > 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](mailto:commcare-users+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Simon\_Berry](https://dimagi.b-cdn.net/user_avatar/forum.dimagi.com/simon_berry/32/492_2.png) [@Simon\_Berry](https://forum.dimagi.com/u/Simon_Berry)\
**Post date:** [February 19, 2016, 3:32pm UTC](https://forum.dimagi.com/t/overwriting-case-property-with-missing-value/2606/3 "2016-02-19T15:32:28Z")

</div>

Thank you Will.

That's the reassurance I needed.

Regards

Simon  
19/2/16

> **···**
>
> On 19 February 2016 at 16:11, William Pride wrote:
> 
> > Simon,
> > 
> > By default no not-displayed questions will be saved to the case. If the  
> > display condition of a question is false then that node will (in XForm's  
> > view) not exist and so the bind setting the case property to that value  
> > will not fire.
> > 
> > Best,  
> > Will
> > 
> > On Fri, Feb 19, 2016 at 12:31 AM, Simon Berry [simon@colalife.org](mailto:simon@colalife.org) wrote:
> > 
> > > In our application cases are retailers and we have forms for putting  
> > > retailers on the system and editing them.
> > > 
> > > In addition we have a visit form which gathers data when a retailer is  
> > > visited.
> > > 
> > > I am updating the visit form so that it checks for key missing data from  
> > > the case and, if data is missing from the case (eg retailer GPS location,  
> > > retailer gender etc), it requests it at the end of the normal visit form.
> > > 
> > > I'm doing this using hidden values which load the current value of the  
> > > property (which may or may not be missing) from the case. Then the visit  
> > > form has "additional questions" with display conditions on them so that  
> > > they are only displayed (ie asked) if the hidden value is '' or '---'.
> > > 
> > > Then, at the end of the visit form the values of the "additional  
> > > questions" are saved to the case.
> > > 
> > > My question is:
> > > 
> > > 1. If the "additional questions" (eg the retailer location) are not  
> > > asked (because they are already known) what gets saved back to the case  
> > > when the visit form is submitted? I'm concerned that a missing value might  
> > > get saved back to the case and overwrite a known value. Although I could  
> > > test this, I don't want to submit 'test' visit forms as there is no way of  
> > > deleting them later and this will complicate analyses we do on this data in  
> > > the future.
> > > 
> > > Thanks
> > > 
> > > Simon
> > > 
> > > --  
> > > 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](mailto:commcare-users+unsubscribe@googlegroups.com).  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "commcare-users" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/commcare-users/YsIcJWprt1o/unsubscribe](https://groups.google.com/d/topic/commcare-users/YsIcJWprt1o/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [commcare-users+unsubscribe@googlegroups.com](mailto:commcare-users+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
