ODK Validate Errors, Survey123

3276
7
Jump to solution
03-29-2019 12:15 PM
LaineyLe_Blanc1
New Contributor II

I cannot figure out what is causing this error message when I try to validate my Survey123 form. The error message is attached as well as my form. I've double checked my relevant questions and haven't been able to figure out what is causing this error. The result is only described as invalid.  

0 Kudos
1 Solution

Accepted Solutions
Philip-Wilson
Esri Notable Contributor

Hi Lainey,

The error is occurring because of the relevant statement on the ${LSnatural} question, it is creating a dependency cycle. The expression you have entered is referring to itself. You can't have a relevant statement that has an outcome based on requiring the answer from the same question.

Phil.

View solution in original post

7 Replies
Philip-Wilson
Esri Notable Contributor

Hi Lainey,

The error is occurring because of the relevant statement on the ${LSnatural} question, it is creating a dependency cycle. The expression you have entered is referring to itself. You can't have a relevant statement that has an outcome based on requiring the answer from the same question.

Phil.

LaineyLe_Blanc1
New Contributor II

That fixed it, thanks Philip! 

LeahSperduto
New Contributor III

Hi Phil,

Wondering if there are any workarounds or thoughts on how one might create a "summary" or notes including a field within a survey in a different area than where the same field needs to be edited/calc later in the survey - without getting the dependency issue?   

We have a survey with 6+ groups and would like to have a summary in one of the first groups that draws data from a different field in a group further down the survey.  We are attempting to use a note field ${PreviousResponse} (so it is un-editable) with a calculation from another field ${ResponseNotes}(to create the summary of existing data), then in another group of fields, want to allow the user to add additional notes to another field and be concatenated to the original field ${ResponseNotes}.  However, we are running into the dependency cycle issue.  Ideally, we'd be able to only allow them to add to the existing field - not edit the existing content, hence the reason for an additional "Fake" field. Hoping to allow the comment field to take in additional field values calculation (such as current date and cancelation reason) have to allow users to edit the existing content in the field. 

We considered diving into using javascript but the dependency error persists with what we have tried.   

Do you know a way we could do this within or can you think of a workaround within connect and/or a javascript function?  

I've included the form below and highlighted the affected fields.

Thanks in advance! LS   

Added: The summary field at the beginning of the survey would only need to show what was originally included in the content of the ${ResponseNotes} field upon opening the survey.  

0 Kudos
Philip-Wilson
Esri Notable Contributor

Hi @LeahSperduto,

Thanks for sharing your form and workflow. We will take a look and get back to you soon with any suggestions. 

Regards,

Phil.

0 Kudos
MichelleWilliams1
Occasional Contributor III

Help please,

I have two fields that collect data and one field I want to pulldata().

Is there a correct way to do this I'm getting the ODK error. 

if(${Contract}=pulldata('Contract_working2019', 'ContractName','ContractNumber',${Contract}), if(${LicenseeWriteIn}=pulldata('Contract_working2019', 'ContractNumber','ContractName',${LicenseeWriteIn}) 

Thanks in advance.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Michelle,

Your if() statements are incomplete; you are not assigning values based on if a value is true or false.  Currently, the logic  you have is:

1. Does Contract equal a value looked up from Contract_working2019 in the ContractName column based on Contract?

   1a.  If Yes: Does the LiceseeWriteIn value equal the value in ContractNumber column based on the value in ContractName equalling the LicenseeWriteIn value?

       1a i.  If Yes: ????

       1a ii. If No: ????

    1b.  If No: ????

I would also check to make sure the if/pulldata statements are doing what you would want - they seem very circular in logic to me (first seeing if a value in the ContractName column matches the value in the ContractNumber column which you are using for lookup, and then seeing if a value in the ContractNumber matches the value in the ContractName column, which is being used for lookup).

Min-HungChou
New Contributor II

My problem appears to be related to having a ' sigh in the schema name. When I removed them, I was able to publish again. 

0 Kudos