I am trying to restrict a numbers (integer) entered based on the previous select one question

greetings,

i am building a form trying to restrict the numbers (integer) entered based on the previous question which is state.
for example if he choses California hell only be allowed to enter numbers between 1-100 and if he chooses Texas hell only be allowed to enter numbers between 1-200 and so on.

is there a condition for this kind of case

@alpha, is your previous question a select_one question type or a text question type?

hello @Kal_Lam, my question is select one type

@alpha, you should be able to do it as outlined in the image shared below:

In the survey tab of your XLSForm:

In the choices tab of your XLSForm:

Image 2

Data entry screen as seen in Enketo: when the entry is within the ranage

Data entry screen as seen in Enketo: when the entry is outside the ranage

Data entry screen as seen in Enketo: when the entry is within the ranage

Data entry screen as seen in Enketo: when the entry is within the ranage

Data entry screen as seen in Enketo: when the entry is outside the ranage

Reference XLSForm:

Constraint in Integer.xlsx (12.1 KB)

thank you @Kal_Lam, that was very helpful, although i did not consider the range in an excel cell will be that lengthy, apparently not all of my condition can fit in one cell, is there another way to do this maybe by using calculation type

thank you for the assistance

Hi @alpha, a cell in excel can hold 32,767 characters maximum. Is your condition bigger than this?

1 Like

hello @hakan_cetinkaya, unfortunately yes

Wow :exploding_head: