Constraints within multiple answer question - ERROR message

Hello, I am trying to apply constraints within a multiple response question but I doesn’t seem to work and I get an Error message
ODK Validate Errors: >> XForm is invalid. See above for the errors. : Cycle detected in form’s relevant and calculation logic! The following nodes are likely involved in the loop: ${D7_langues_parlees} ${Autres_pays_de_naissance_001} The following files failed validation: ${tmp0kk_0dkh} Result: Invalid

What I am trying to do is:
If someone responds Je ne sais pas/Je ne me prononce pas (8), then they can’t select any other response.

nj9wj25 1 Malagasy
nj9wj25 2 Français
nj9wj25 3 Allemand
nj9wj25 4 Italien
nj9wj25 5 Anglais
nj9wj25 6 Romansh
nj9wj25 7 Autre, précisez
nj9wj25 8 Je ne sais pas/Je ne me prononce pas

I wrote this but it doesn’t work. Does anyone have any suggestion?
select_multiple nj9wj25 D7_langues_parlees D7. Quelle(s) langue(s) parlez-vous couramment?* (plusieurs réponses possibles) false not(selected(., ‘8’) and (selected(.,’7’) or selected(.,’6’) or selected(.,’5’) or selected(.,’4’) or selected(.,’3’) or selected(.,’2’) or selected(.,’1’)))

@tiana_anjara, this post discussed previously should help you solve your issue:

Hello, thanks for this. I am still getting an error message. I tried not to change the answer name but I get the same result. Can you see why in the code?

Please contact [support@kobotoolbox.org](mailto:support@kobotoolbox.org?subject=loading%20errors%20for:%20https%3A%2F%2Fee.kobotoolbox.org%2Fpreview%2Fi%2FbETm1yer&body=*%20FormLogicError%3A%20Could%20not%20evaluate%3A%20not(selected(.%2C%20%27je_ne_sais_pas_je_ne_me_prononce_pas%27)%20and%20(selected(.%2C%27autre__pr_cisez%27)%20or%20selected(.%2C%27romansh%27)%20or%20(selected(.%2C%27anglais%27)%20or%20selected(.%2C%27italien%27)%20or%20selected(.%2C%27allemand%27)%20or%20selected(.%2C%27fran_ais%27)%20or%20selected(.%2C%27malagasy%27)))%2C%20message%3A%20Stuff%20left%20on%20stack.%7B%22stack%22%3A%5B%7B%22t%22%3A%22root%22%2C%22tokens%22%3A%5B%5D%7D%2C%7B%22v%22%3A%22not%22%2C%22t%22%3A%22fn%22%2C%22dead%22%3Afalse%2C%22tokens%22%3A%5B%7B%22t%22%3A%22bool%22%2C%22v%22%3Afalse%7D%2C%7B%22t%22%3A%22op%22%2C%22v%22%3A4%7D%2C57005%5D%7D%5D%2C%22cur%22%3A%7B%22v%22%3A%22%22%7D%7D) with the link to this page and the error message below:

  • FormLogicError: Could not evaluate: not(selected(., ‘je_ne_sais_pas_je_ne_me_prononce_pas’) and (selected(.,‘autre__pr_cisez’) or selected(.,‘romansh’) or (selected(.,‘anglais’) or selected(.,‘italien’) or selected(.,‘allemand’) or selected(.,‘fran_ais’) or selected(.,‘malagasy’))), message: Stuff left on stack.{“stack”:[{“t”:“root”,“tokens”:[]},{“v”:“not”,“t”:“fn”,“dead”:false,“tokens”:[{“t”:“bool”,“v”:false},{“t”:“op”,“v”:4},57005]}],“cur”:{“v”:""}}

@tiana_anjara, I would also advise you to validate your XLSForm through this online validator. The online validator should be able to help you identify syntax issues present in your XLSForm.

1 Like