Auto checked select_one based on field

Hi, I need help please.
I would like when I enter in a field named dwelling_place the value “tipi”,
the next question in the field named category ,the option “fisherman”
is automatically checked (see picture below).

problem_form

how to fix this issue?
Excuse my english…

Hi @evariste,

Welcome to the community! Would you mind having a look at the discussion discussed earlier (it should help solve you issue):

GOOD DAY!

Hi @Kal_Lam

Thank you for your reply , i use calculation column but i got an error and i cannot deploy my form.
the error : ODK Validate Errors: >> Something broke the parser. See above for a hint. Dependency cycles amongst the xpath expressions in relevant/calculate Result: Invalid

here is my xlsfie form (see picture below):

Thanks in advance.

Hello,
sorry, but your syntax in the if statement is wrong. Syntax is if(boolean condition, string then, string else).
So, you cannot use a set-construct like var= value in if returns.
See
https://docs.opendatakit.org/form-operators-functions/#control-flow for specification
Advanced calculate function using if-statement
and
http://support.kobotoolbox.org/en/articles/1913851-advanced-use-of-calculate-questions
Kind regards

2 Likes

the correct syntax : if(${dwelling_place} = 'tipi' , '2__fisherman','nochoice')

It’s work.
thank you all.

2 Likes