Multiple Constraints

Essentially what I want to do is test an age variable against the
variable defining the interviewee's relationship to the household
head. If the interviewee is too young to have this type of
relationship to the household head, I want a message to pop up stating
so. I believe this would require me to program in multiple constraints
for the same variable. I've tried listing the constraints on separate
lines, and although ODK collect will allow me to view the survey the
constraints don't work as programmed. I've tried combining them in a
single line of code and I get an error in validate that I have already
defined the constraint. Has anyone programmed in multiple/complex
constraints/have suggestions?

To clarify, what I want is the ability to program in different error
messages to display depending on which constraint is violated.

Example: Respondent lists their age and their relationship to the head
of household. The answers are then tested against a set of
constraints. If the answers violate a constraint a tailored message
pops up explaining this violation.

ยทยทยท On Nov 17, 10:54 am, Ulli wrote: > Essentially what I want to do is test an age variable against the > variable defining the interviewee's relationship to the household > head. If the interviewee is too young to have this type of > relationship to the household head, I want a message to pop up stating > so. I believe this would require me to program in multiple constraints > for the same variable. I've tried listing the constraints on separate > lines, and although ODK collect will allow me to view the survey the > constraints don't work as programmed. I've tried combining them in a > single line of code and I get an error in validate that I have already > defined the constraint. Has anyone programmed in multiple/complex > constraints/have suggestions?

hi
how to use of multiple constraint in bind ?

we want this capability but it's not currently possible. only one constraint
(and option custom constraint message) per question.

ยทยทยท On Wed, Nov 17, 2010 at 12:06 PM, Ulli wrote:

To clarify, what I want is the ability to program in different error
messages to display depending on which constraint is violated.

Example: Respondent lists their age and their relationship to the head
of household. The answers are then tested against a set of
constraints. If the answers violate a constraint a tailored message
pops up explaining this violation.

On Nov 17, 10:54 am, Ulli unisc...@gmail.com wrote:

Essentially what I want to do is test an age variable against the
variable defining the interviewee's relationship to the household
head. If the interviewee is too young to have this type of
relationship to the household head, I want a message to pop up stating
so. I believe this would require me to program in multiple constraints
for the same variable. I've tried listing the constraints on separate
lines, and although ODK collect will allow me to view the survey the
constraints don't work as programmed. I've tried combining them in a
single line of code and I get an error in validate that I have already
defined the constraint. Has anyone programmed in multiple/complex
constraints/have suggestions?

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

Use logical operators (and, or). Below is an example.

Yaw

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

On Thu, Aug 20, 2015 at 1:21 AM, bikram.k@ptas.com.np wrote:

hi
how to use of multiple constraint in bind ?

--

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.

option -> optional

ยทยทยท On Wed, Nov 17, 2010 at 12:49 PM, Drew Roos wrote:

we want this capability but it's not currently possible. only one
constraint (and option custom constraint message) per question.

On Wed, Nov 17, 2010 at 12:06 PM, Ulli unischan@gmail.com wrote:

To clarify, what I want is the ability to program in different error
messages to display depending on which constraint is violated.

Example: Respondent lists their age and their relationship to the head
of household. The answers are then tested against a set of
constraints. If the answers violate a constraint a tailored message
pops up explaining this violation.

On Nov 17, 10:54 am, Ulli unisc...@gmail.com wrote:

Essentially what I want to do is test an age variable against the
variable defining the interviewee's relationship to the household
head. If the interviewee is too young to have this type of
relationship to the household head, I want a message to pop up stating
so. I believe this would require me to program in multiple constraints
for the same variable. I've tried listing the constraints on separate
lines, and although ODK collect will allow me to view the survey the
constraints don't work as programmed. I've tried combining them in a
single line of code and I get an error in validate that I have already
defined the constraint. Has anyone programmed in multiple/complex
constraints/have suggestions?

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

thanks for your suggestion.

ยทยทยท On Fri, Aug 21, 2015 at 12:17 AM, Yaw Anokwa wrote:

Use logical operators (and, or). Below is an example.

Yaw

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

On Thu, Aug 20, 2015 at 1:21 AM, bikram.k@ptas.com.np wrote:

hi
how to use of multiple constraint in bind ?

--

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.

--

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 a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/opendatakit/fLB-btzKEuI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Regards,
Bikram

Is this a limitation within ODK or JavaRosa? Is this a feature that
could eventually be added?

ยทยทยท On Nov 17, 12:50 pm, Drew Roos wrote: > option -> optional > > > > > > > > On Wed, Nov 17, 2010 at 12:49 PM, Drew Roos wrote: > > we want this capability but it's not currently possible. only one > > constraint (and option custom constraint message) per question. > > > On Wed, Nov 17, 2010 at 12:06 PM, Ulli wrote: > > >> To clarify, what I want is the ability to program in different error > >> messages to display depending on which constraint is violated. > > >> Example: Respondent lists their age and their relationship to the head > >> of household. The answers are then tested against a set of > >> constraints. If the answers violate a constraint a tailored message > >> pops up explaining this violation. > > >> On Nov 17, 10:54 am, Ulli wrote: > >> > Essentially what I want to do is test an age variable against the > >> > variable defining the interviewee's relationship to the household > >> > head. If the interviewee is too young to have this type of > >> > relationship to the household head, I want a message to pop up stating > >> > so. I believe this would require me to program in multiple constraints > >> > for the same variable. I've tried listing the constraints on separate > >> > lines, and although ODK collect will allow me to view the survey the > >> > constraints don't work as programmed. I've tried combining them in a > >> > single line of code and I get an error in validate that I have already > >> > defined the constraint. Has anyone programmed in multiple/complex > >> > constraints/have suggestions? > > >> -- > >> Post: opendatakit@googlegroups.com > >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com > >> Options:http://groups.google.com/group/opendatakit?hl=en

javarosa, and yes

ยทยทยท On Wed, Nov 17, 2010 at 1:09 PM, Arthur wrote:

Is this a limitation within ODK or JavaRosa? Is this a feature that
could eventually be added?

On Nov 17, 12:50 pm, Drew Roos dr...@dimagi.com wrote:

option -> optional

On Wed, Nov 17, 2010 at 12:49 PM, Drew Roos dr...@dimagi.com wrote:

we want this capability but it's not currently possible. only one
constraint (and option custom constraint message) per question.

On Wed, Nov 17, 2010 at 12:06 PM, Ulli unisc...@gmail.com wrote:

To clarify, what I want is the ability to program in different error
messages to display depending on which constraint is violated.

Example: Respondent lists their age and their relationship to the head
of household. The answers are then tested against a set of
constraints. If the answers violate a constraint a tailored message
pops up explaining this violation.

On Nov 17, 10:54 am, Ulli unisc...@gmail.com wrote:

Essentially what I want to do is test an age variable against the
variable defining the interviewee's relationship to the household
head. If the interviewee is too young to have this type of
relationship to the household head, I want a message to pop up
stating

so. I believe this would require me to program in multiple
constraints

for the same variable. I've tried listing the constraints on
separate

lines, and although ODK collect will allow me to view the survey the
constraints don't work as programmed. I've tried combining them in a
single line of code and I get an error in validate that I have
already

defined the constraint. Has anyone programmed in multiple/complex
constraints/have suggestions?

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.comopendatakit%2Bunsubscribe@googlegroups.com
<opendatakit%2Bunsubscribe@googlegr oups.com>

Options:http://groups.google.com/group/opendatakit?hl=en

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

Hi, sorry to bump up this old conversation but I'm curious if this was ever added as feature of if there's any workaround?

EDIT: To clarify, I'm interested if you can have multiple constraint messages that could be dependent on different constraint violations

Welcome to the ODK forum, @nsivewright ! We're glad you're here. When you get a chance, please introduce yourself here. I'd also encourage you to add a real picture as your avatar because it helps build community!

Can you provide a more detailed use-case example? Or better yet, an excerpt from a form where you would like to implement this?

1 Like