Survey123 drops calculations

461
3
08-22-2022 02:32 PM
Jean-SebastienLauzon
New Contributor III

I have a survey that has been active for a few years. 

Over the last few months (4?), one of the calculate field is missing from the published survey. there are no errors and everything seems to be working fine but the field is blank in the data online. 

the field type is "calculate" and the calculation is : if(${value1}>=${value2},${value1}-${value2},${value1})

Both value1 and value2 field are present but in some cases the value of the calculate field is left blank when the survey is submitted instead of posting the value of the calculation. 

there seem to be no logic or pattern to explain why the field is sometime left blank and sometime contains the correct value.

Please help!

 

 

0 Kudos
3 Replies
ZacharySutherby
Esri Regular Contributor

Hello @Jean-SebastienLauzon

With the 3.14 release of Survey123 (~March of this year) there was a significant overhaul of how expressions are run to help improve app stability. Since then we've seen a few issues that have come up due to the changes made specifically around reloading surveys from Drafts/Outbox for example especially if they have relevancy set on them. It may be possible on the records where you are seeing blank values the field user may have saved the record to Drafts or the Outbox and ran into a defect from the 3.14 change. 

I would suggest reaching out to Esri Technical Support and pass along your XLSForm for testing and they can confirm if you are running into one of our known issues or a new issue. 

Thank you,
Zach
Jean-SebastienLauzon
New Contributor III

Thanks for the info and advice, I've contacted ESRI Tech support and sent them the XLSForm. 

I should have mentioned that the calculate field is inside a repeat and it looks like this is causing the issue. If I create a new survey with this field in a repeat I get the same behaviour (field left blank "sometime"), but if I create a survey and the calculate field is not in the repeat, it seems to never be left blank. 

 

0 Kudos
Jean-SebastienLauzon
New Contributor III

After much trial and error, I think I understand why this only occurs sometimes. 

If there is a calculation within a repeat, if a user using an iphone device doesn't either press "done" on the phone's keyboard or enters value in another field so that the cursor is not in the field used by the calculation prior to adding a repeat (pressing the plus sign), the calculation will not be completed. 

Seems to me like there is a bug here. 

Note that the value entered in the field is being passed through either way, but the calculation depending on it does not. 

This behaviour cannot be repeated if submitting a survey through the web browser interface.

0 Kudos