Hi @Kal_Lam ! We are trying to build a form based on gender (we are interested by gender disparities). Basically what we would like to do is build the form based on the first question : the first question would be gender [male, female]. Then I would like the next questions to be specific to that first answer.
We don’t want two different forms since chosing the appropriate form manually could cause bias.
What do you think we should do? I was thinking maybe using the cascading selects, but I am worried it is going to mess with the data analysis since the forms for both genders are quite loaded.
If it makes any difference, we are working in XLS format.
So I tried to figure out if I could build a different form based on the selected gender. Based on what I read here, my best solution might be to create a condition for each gender.
For example, if a subject answers that she is a woman (gender=female) then she will have additional answer choices in certain questions (concerning menstrual periods, for example).
I’ve tried to build a “test” questionnaire by integrating conditions, but I get this error message when I request the preview.
Can you please help me ?
FormLogicError: Could not evaluate: if(( /model/instance[1]/a69HeGowW9dKwZxPwajAXD/gender =‘male’), ‘condition1’, if(( /model/instance[1]/a69HeGowW9dKwZxPwajAXD/gender =‘female’), ‘condition2’)), message: Cannot read properties of undefined (reading ‘t’)
Welcome to the community, @benoitjeanne! Could you simply provide a dummy question and its choices along with the requirements for the choices should be displayed? Just provide a maximum of two questions or even one if it’s enough.
The community should be able to help you out if it’s possible in KoboToolbox.
Choice 1 (appears for condition 1,2)
Choice 2 (appears for condition 1,2)
Choice 3 (appears for condition 1,2)
Choice 4 (appears for condition 2 only)
Choice 5 (appears for condition 2 only)
Question 3
Choice i (appears for condition 1,2)
Choice ii (appears for condition 1,2)
Choice iii (appears for condition 1,2)
Choice iv (appears for condition 2 only)
So your initial post suggested you wanted two completely different forms, depending on an initial selection of male vs female; that is, forms with completely different gender-specific questions.
However, the above actually suggests you instead really want to basically ask the same questions, but present a different subset of options for your select questions, depending on the initial selected sex.
If that’s the case, then you can probably best accomplish this with a single set of the same questions, but filter the presented options (depending on chosen sex) using a choice_filter.
It uses a choice_filter to filter the options presented in the followup question - Q2 and Q3 -depending on the response to Q1 (I happen to be using a selected() function to accomplish this, since I think its results in the most intuitive form…). As you can see, depending of what sex you pick, the displayed options change accordingly:
The trick is to add another column to your options table (eg ‘sex’) and populate this according to what options you want to display depending on previously acquired data. Hopefully its somewhat obvious what I’ve done here…