ODK Validate Error & XPath Dependency Cycle

2727
3
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

3 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.

View solution in original post

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.