ODK Validate Error & XPath Dependency Cycle

4816
5
Jump to solution
09-11-2017 08:01 AM
OscarSepulveda_III
Occasional Contributor

Ok, I have been racking my brain for the last day regarding this error shown below.  Attached are the two spreadsheets I utilize.

0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Oscar,

It looks like the 'dependency cycle' error is the one holding up the survey.  You have two fields that have a calculation statement that refer to themselves (start_time and end_time) - fields cannot refer to themselves in a calculation, as that might cause an endless loop.  removing the calculation (and constraint, which doesn't make sense in a date time question) allowed the form to generate successfully.

View solution in original post

5 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Oscar,

It looks like the 'dependency cycle' error is the one holding up the survey.  You have two fields that have a calculation statement that refer to themselves (start_time and end_time) - fields cannot refer to themselves in a calculation, as that might cause an endless loop.  removing the calculation (and constraint, which doesn't make sense in a date time question) allowed the form to generate successfully.

SavannahWinstanley1
New Contributor II

Hi James, 

I'm running into this same problem with a pulldata calculation. The basic functionality desired is a two-way pulldata based on fields Common Name and Scientific Name. I have a csv attached with common names, scientific names, species code, and genus. The user wants to be able to type in either a common or scientific name into the select one box, and from either of those generate the dependent fields (code, common/botanical, and genus).

Is this possible to do with a workaround somehow? I have tried creating duplicate hidden fields which paste the select one answers as text, and reference those instead but am still getting the error referenced above.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Savannah,

A two way lookup (lookup in common, get scientific; look up in scientific, get common) can't be done in Survey123 - as the error indicates, it could create a cycle of continuous lookups.  One way around would be to have a hidden field that looks up the value based on if common is present (look up scientific) or scientific (copy over) is filled in.

AditiPanhalkar
New Contributor II

Hi James, 

I'm having similar problems when using an 'if' function. The functionality required is- if the current question is left blank (not answered) then replace with '0', alternately if the question was answered then return the answered value. I feel like this is a fairly simple situation but I keep getting the above mentioned error. The question is a 'Text' question so I'm using the string-length function within the if expression. 

P.S I have beginner's level knowledge of survey123 connect! 

0 Kudos
JeremieCote
New Contributor III

You could simply put 0 in the default column of your question.

0 Kudos