Relevant bind attribute and losing preloaded data

We have an xform that is preloaded with certain data using ODKCollect. One of the data items is a select1 Relationship to Head of Household, which is not prepopulated.

In certain cases, when we know beforehand that an individual is in fact the head of household, we'd like to prepopulate the select1 with that information and have the question be skipped entirely, presumably using relevant=false, which could be evaluated by using an invisible variable with its own binding that would also be preloaded.

I've noticed however that when our preloaded select1 is successfully preloaded, and by extension relevant is set to false using our invisible variable, the Relationship to Head of Household data is not included in the finalized form - the xml element disappears entirely. When relevant=true, the preloaded data is returned as expected.

Is it the case that, when an element is evaluated as relevant=false, the form dismisses the data element entirely, even if it is preloaded?

If so, have people found any workarounds to deal with this?

Any insights appreciated.

x-posted at https://groups.google.com/forum/#!topic/formhub-users/XwYWKeZw28o
as well

The relevant flag governs both whether the question is presented to the
user AND whether the data is saved and submitted up to ODK Aggregate.

This is dictated by the XForms spec
http://www.w3.org/TR/2012/WD-xforms20-20120807/#The_relevant_Property and
therefore will always be a limitation of ODK Collect.

This confounding of user interaction with data retention is eliminated in
the ODK 2.0 tools (e.g., Survey).

Mitch

··· On Fri, Jun 6, 2014 at 6:51 AM, wrote:

We have an xform that is preloaded with certain data using ODKCollect.
One of the data items is a select1 Relationship to Head of Household,
which is not prepopulated.

In certain cases, when we know beforehand that an individual is in fact
the head of household, we'd like to prepopulate the select1 with that
information and have the question be skipped entirely, presumably using
relevant=false, which could be evaluated by using an invisible variable
with its own binding that would also be preloaded.

I've noticed however that when our preloaded select1 is successfully
preloaded, and by extension relevant is set to false using our invisible
variable, the Relationship to Head of Household data is not included in the
finalized form - the xml element disappears entirely. When relevant=true,
the preloaded data is returned as expected.

Is it the case that, when an element is evaluated as relevant=false, the
form dismisses the data element entirely, even if it is preloaded?

If so, have people found any workarounds to deal with this?

Any insights appreciated.

x-posted at
https://groups.google.com/forum/#!topic/formhub-users/XwYWKeZw28o
as well

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

One good workaround is to make the select1 readonly when you know that
relationship. That is, put the relevant logic into the readonly
attribute. This guarantees that the user can't change the answer when
they see that prompt and the data shows up in your final result.

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Fri, Jun 6, 2014 at 12:00 PM, Mitch Sundt mitchellsundt@gmail.com wrote:

The relevant flag governs both whether the question is presented to the user
AND whether the data is saved and submitted up to ODK Aggregate.

This is dictated by the XForms spec
http://www.w3.org/TR/2012/WD-xforms20-20120807/#The_relevant_Property and
therefore will always be a limitation of ODK Collect.

This confounding of user interaction with data retention is eliminated in
the ODK 2.0 tools (e.g., Survey).

Mitch

On Fri, Jun 6, 2014 at 6:51 AM, andrew.dorman.taylor@gmail.com wrote:

We have an xform that is preloaded with certain data using ODKCollect.
One of the data items is a select1 Relationship to Head of Household, which
is not prepopulated.

In certain cases, when we know beforehand that an individual is in fact
the head of household, we'd like to prepopulate the select1 with that
information and have the question be skipped entirely, presumably using
relevant=false, which could be evaluated by using an invisible variable with
its own binding that would also be preloaded.

I've noticed however that when our preloaded select1 is successfully
preloaded, and by extension relevant is set to false using our invisible
variable, the Relationship to Head of Household data is not included in the
finalized form - the xml element disappears entirely. When relevant=true,
the preloaded data is returned as expected.

Is it the case that, when an element is evaluated as relevant=false, the
form dismisses the data element entirely, even if it is preloaded?

If so, have people found any workarounds to deal with this?

Any insights appreciated.

x-posted at
https://groups.google.com/forum/#!topic/formhub-users/XwYWKeZw28o
as well

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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