Constraints on a group level

I have a group of fields which i want to validate in the following manner:

  • If one of them is filled, then all should be filled.
  • If none of them is filled then it should be okay to leave all blank

I'm using xls forms and i can't be able to figure out how to do this, does
anybody have any suggestions?

I don't think you can do this.

What you can do is ask a general question to determine if the user should
be filling one or more fields out, then ask the specific questions.

E.g.,

Have you taken any medications in the last month?

Which medications have you taken?
....

··· On Tue, Apr 29, 2014 at 3:40 AM, Bosco Mutung'a wrote:

I have a group of fields which i want to validate in the following manner:

  • If one of them is filled, then all should be filled.
  • If none of them is filled then it should be okay to leave all blank

I'm using xls forms and i can't be able to figure out how to do this, does
anybody have any suggestions?

--

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

Another approach that might suit is to add a question after the group that
is only relevant if some but not all of the group's questions have been
filled in. This question can show the error message.

If you make this question:

  • read only
  • required
  • type: integer
  • constraint: something arbitrary

Then the user won't be able to get past this error message unless they go
back and fix the questions that caused the problem. Here is an example
xlsform:

regards

Neil

··· On Wed, Apr 30, 2014 at 3:59 AM, Mitch Sundt wrote:

I don't think you can do this.

What you can do is ask a general question to determine if the user should
be filling one or more fields out, then ask the specific questions.

E.g.,

Have you taken any medications in the last month?

Which medications have you taken?
....

On Tue, Apr 29, 2014 at 3:40 AM, Bosco Mutung'a boscomutunga@gmail.comwrote:

I have a group of fields which i want to validate in the following manner:

  • If one of them is filled, then all should be filled.
  • If none of them is filled then it should be okay to leave all blank

I'm using xls forms and i can't be able to figure out how to do this,
does anybody have any suggestions?

--

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.

--

Smap Consulting http://smap.com.au/| Mobile Data Collection Solutions
Application Developer - neilpenman@gmail.com minqiang.huang@gmail.com
Twitter: @dgmsot
Skype: ianaf4you
Phone: +61 402 975 959
Blog: http://blog.smap.com.au http://smap.com.au/blog