Parenthesis mismatch

i am having a parenthesis mismatch in this relevant condition, kindly help not(selected(${inputused}, '10' or not(selected(${inputused}, '9' or not(selected(${inputused}, '8' or not(selected(${inputused}, '7' or not(selected(${inputused}, '6' or not(selected(${inputused}, '5' or not(selected(${inputused}, '4' or not(selected(${inputused}, '3' or not(selected(${inputused}, '2' or not(selected(${inputused}, '1')))

There may be an easier way to do it - can you share the full question and describe what you want this survey logic to do?

1 Like

Wekcome @kefaas,
You have syntax errors, closing brackets before or are missing. You can always check your form with Central or the Online validator, please.

Your formula could be: not( selected(${inputused}, '10') or .... or selected(..., ...) ). You might use one single negation outside the main brackets. Even, if you use a select_one, you don't need selected, i.e. (selected(${inputused}, '10'), you can just use simple comparison, i.e. ${inputused} = '10'. So, you could also work with mathematical comparison, for example: ( number(.) >= 10 ).

Maybe you can specify your concrete requirement here textually, please, to get better help.

1 Like

Ciao @kefaas,

In addition to suggestions from previous responses, it seems you have a list of not allowed selections items, using the same concept of selected() function which return a true or false evaluation of parameters, you could easily achieve the same goal by using:
not(selected(‘1 2 3 4 5 7 8 9 10’, ${inputused}) which would check if the provided answer is not part of the array of undesired options. You can amend the array by adding or removing the numbers separate by a space.

In your case, it looks like option 6 is the only number you want selected, if correct, you can simplify the contraint/relevant with selected(${inputused}, ‘6’)

This method should work fine with select_one(), multiple options would need more tweaking. I did not test this on an actual form, please give it a try and revert as necessary

Happy ODKing,
Jules R

1 Like

6 seems in the list.

1 Like