Error occurred during deployment, although there were no errors during previewing

Hi,

I am facing an error during deployment, even though there are no errors when previewing the form. The error seems to occur because I created rules for 10 select_one questions:

  1. The options are limited to one: Choose.
  2. The option will disappear in the other 9 questions if one question has already been selected.
  3. Mandatory for all 10 questions if none of the questions have been selected.
  4. This mandatory requirement will disappear in the other 9 questions if one question has already been selected.
type name required choice_filter
select_one ya calon1 ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon2 ${calon1}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon3 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon4 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon5 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon6 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon7 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon8 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon9}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon9},name)) and not(selected(${calon10},name))
select_one ya calon9 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon10}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon10},name))
select_one ya calon10 ${calon1}=β€˜β€™ and ${calon2}=β€˜β€™ and ${calon3}=β€˜β€™ and ${calon4}=β€˜β€™ and ${calon5}=β€˜β€™ and ${calon6}=β€˜β€™ and ${calon7}=β€˜β€™ and ${calon8}=β€˜β€™ and ${calon9}=β€˜β€™ not(selected(${calon1},name)) and not(selected(${calon2},name)) and not(selected(${calon3},name)) and not(selected(${calon4},name)) and not(selected(${calon5},name)) and not(selected(${calon6},name)) and not(selected(${calon7},name)) and not(selected(${calon8},name)) and not(selected(${calon9},name))

I need help please.

Welcome to the community, @bayu_skm! Have you validated your XLSForm through this online validator? The online validator should help you identify syntax issues if any are present that are affecting your deployment.

Hi @Kal_Lam
sorry, I cannot attach the file because I am a new user.
Here is the error that occurred:

Error: ODK Validate Errors:
>> XForm is invalid.
: Cycle detected in form’s relevant and calculation logic!
The following nodes are likely involved in the loop:
${calon1}
${calon8}
${calon3}
${calon6}
${calon5}
${calon7}
${calon4}
${calon2}
${calon9}
${calon10}

The following files failed validation:
${election}.xml

Result: Invalid

I still do not understand where the error lies.

@bayu_skm, you should now be able to attach.

Welcome @bayu_skm,
Could you explain verbally, please, what you want to implement?

1 Like

Hi @Kal_Lam and @wroos ,

election.xlsx (10.7 KB)

As mentioned in my first post, I want to create a 10 candidates election form with the following rules:

  1. a) The answer option is limited to one: Choose; b) Mandatory for all 10 questions if none of the questions have been selected

  2. The answer option and mandatory requirement will disappear in the other 9 questions if one question has already been selected

During the form preview, everything went smoothly with no issues.

However, during deployment, an error message appeared, and I still do not understand where the error lies.

You appear to have (multiple) mutual dependencies between the relevant calculations. For example

This says that calon1 is dependent on ... and ${calon10}=''

But at the same time, calon10 is dependent on ${calon1}='' and...

hence the required dependency cycle error. It is not possible to determine whether calon1 or calon10 are required because they are essentially mutually co-dependent. XForms doesn’t permit that (ie, its not a matter of who-got-answered-first…).

1 Like

Hi @Xiphware ,

are there any alternative ways to implement this rule?:
a) Mandatory for all 10 questions if none of the questions have been selected.
b) Mandatory requirement will disappear in the other 9 questions if one question has already been selected

This sounds exactly like a mandatory select_one question; ie you must select something, but you may only select a single one. Is there a specific reason you cannot do something (far) simpler, like

SimpleSelect.xlsx (18.1 KB)

[before trying to get your specific form to work, I first want to check you haven’t considered a simpler approach to achieve the same result]

1 Like