Overwriting case property with missing value

5 views
Skip to first unread message

Simon Berry

unread,
Feb 19, 2016, 12:31:24 AM2/19/16
to commcare-users
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

William Pride

unread,
Feb 19, 2016, 9:11:08 AM2/19/16
to commcare-users
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 

--
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-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Berry

unread,
Feb 19, 2016, 10:32:51 AM2/19/16
to commcare-users
Thank you Will.

That's the reassurance I needed.

Regards

Simon
19/2/16



--
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.
To unsubscribe from this group and all its topics, send an email to commcare-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages