How to use constraint for age between 18 to 65 years in KoBo form?

how to use constraint for age between 18 to 65 years in KoBo form

Welcome back to the community, @Hassani! You should be able to use the constraint as discussed in our previous post:

To use a constraint for age between 18 to 65 years in a KoBo form, you can use the “integer” question type and add a “constraint” to it. Here are the steps:

  1. Add an “integer” question type to your form. You can do this by clicking on the “Add Question” button and selecting “integer” from the question type menu.
  2. In the “Question” field, enter a question that asks for the respondent’s age.
  3. In the “Constraint” field, enter the following expression:${value} >= 18 and ${value} <= 65

This expression checks that the value entered by the respondent is greater than or equal to 18 and less than or equal to 65.

  1. Save your form and preview it to test the constraint.

This will ensure that the respondent can only enter an age between 18 to 65 years. If they enter an age outside of this range, they will be prompted to enter a valid age.

1 Like

Thanks indeed for the clarification

1 Like