I'm trying to create a seemingly simple calculation to a field in Survey 123 Connect, but I'm having issues with the syntax.
I want this field to calculate whether or not the previous entries in the same form match. The 'parent_add' is auto populated but the 'siteadd_og' is manually entered. I've tried several iterations of this same equation and they have either failed when converting to the survey itself, or converted with no issue, but then did not function in the survey itself. I've definitely seen examples of this operating with other types of data and simpler calculations, like take the number from question 2 and multiply by 100, which updates live in the form, but I can't seem to replicate this for this scenario.
My enterprise is on version 10.9.1 and Survey 123 is 3.20. I also had issues hiding this question even though I set the visibility to 'hidden' in the excel form.
So far I've tried many versions of this but here are two in the "Calculation" coulmn:
1. if(selected(${siteadd_og} = selected(${parent_add})), 'No', 'Yes')
>>will not convert to the survey
2. if(${siteadd_og} = ${parent_add}, 'No', 'Yes')
>>will convert to survey, but does not function in the form.
Can anyone help me out with this? Please?
in the first statement, are you missing a closing parenthesis for the If?
The second one looks fine but it's unclear what you mean by "does not function in the form". Can you post the XLSX? There could be issues stemming from outside of the if statement.
"I also had issues hiding this question even though I set the visibility to 'hidden' in the excel form"
I believe "hidden" is overridden by the "relevant" and "body::esri:visible" columns. Check for something in those columns.
1. if(selected(${siteadd_og} = selected(${parent_add})), 'No', 'Yes')
>>will not convert to the survey
This is expected. This equation does not follow proper syntax.
Here are some tips:
2. if(${siteadd_og} = ${parent_add}, 'No', 'Yes')
>>will convert to survey, but does not function in the form.
This is proper syntax. Worst case scenario, it should always result in "Yes". If the "No" option isn't working, then the data you are comparing isn't the same (note that it is caps-sensitive).
Any chance you can include your XLSX?