Calculate field not working properly after saving a draft

7587
36
07-13-2018 08:55 AM
RSchaffner
New Contributor III

This may be a new issue in the latest version of Survey123 (3.0.132) because I didn't notice it prior to the week of July 1. I have 4 groups of select_one questions that culminate in a calculated field (sum of the integers from the select_one answers) that is also set to read only. If the survey is started and completed in one attempt, everything works fine. However, it's a long survey, so inspectors often need to save drafts and return later. After reopening the survey, they find one of two things: 1) The select_one answers in each section no longer appear filled in, although the summed field still displays the correct number. 2) Upon starting a new section of select_one questions, the calculate field for that section does not update properly. 

I can remove the read-only option from the calculated fields, but the user is then required to press the refresh icon next to the calculated fields to make them update, and I worry that they will forget to do this, resulting in numerous errors in the data. 

Is there a setting I can adjust to make these fields autocalculate in all situations? I am attaching a truncated version of the survey .xls. The calculated fields are highlighted in yellow. 

0 Kudos
36 Replies
FeichiShih
New Contributor II

I am on 3.10, and I am having a similar problem at the top level (not in a nested repeats) I have a calculated text field that is based on a select, when the select value changes, the calculated text field will change.  However, if I edit the survey from draft or inbox, after updating the select, I have to click the refresh button next to the calculated text field for it to update.  I expect the calculated text field to be updated when I change the select in existing record too, is this not the case?

Update: I did some more testing, looks like the problem is I have a hidden field in between, so the data flow is: select_one -> hidden text field -> text field.  In edit mode, when I change or clear the select_one, the hidden text field is updated but not the text field, unless I click the refresh button next to it. I needed the hidden text field because the calculation was quite complex.  If I remove the hidden field then the text field updated fine.  Another scenario is I have a text field that concat two other fields, if I update or clear those other fields in edit mode, the text field won't refresh unless I click the refresh button.

DougBrowning
MVP Esteemed Contributor

Any update on calculations coming back from Drafts? 

It is really starting to cause major work for us.  When a crew cannot finish in 1 day they must save in drafts for the night.  The next day they are then forced to start a new form and finish.  Then we have to manually go in and try and combine them.  We are starting to get more and more and running out of labor time to fix them.

Since it has been awhile now just checking.  Thanks  @Anonymous User 

by Anonymous User
Not applicable

Hi @DougBrowning ,

This issue is logged as BUG-000127011, however unfortunately it has not been resolved for the upcoming 3.13 release, as it requires further fixes for repeat_count and nested repeats.

Regards,

Phil.

MichelleTanner
New Contributor III

Hello! I would like to add that we are also running into the same issue. We have a survey that needs to be able to function after a draft is saved. We have a field that calculates the count of fields in a repeat. This works fine initially, but after you save the draft and re-open, the calculated field clears and no longer calculates. This has implications across other parts of our workflow. We have a PDF report that uses this calculated field as logic in the report. So when the field is incorrect, not only is the data incorrect, but now their reports are as well.

Any update on when this bug will be fixed?

by Anonymous User
Not applicable

Hi @MichelleTanner,

As mentioned above, the fix for this issue will not make it into the upcoming 3.13 release, but we are aiming to resolve it in a future release. Once more details are available and we have a fix available, you will be able to get early updates via the Early Adopter Community.

Regards,

Phil.

anbinh
by
Occasional Contributor

Hi all, 

 

Although it's been a while since the last post, hope you guys have found your solutions.

Just looking at @FeichiShih 's issue which I just encountered this week in 2022. I had exactly the same issue that “When the data flow is: select_one -> hidden text field -> text field. In edit mode, when I change or clear the select_one, the hidden text field is updated but not the text field, unless I click the refresh button next to it. I needed the hidden text field because the calculation was quite complex. If I remove the hidden field then the text field updated fine.” 

 

I found my solution by using “calculationMode=always” parameter. It works pretty well. Instead of manually clicking the refresh button, enter this parameter in the "bind::esri:parameters" column for the field you need to always keep updated. As documentation Prepopulate answers—ArcGIS Survey123 | Documentation says, this parameter will let the field always gets recalculated when any value referenced in the calculation expression changes.

 

Hope it can still be helpful to any of you.

 

Cheers,

 

ThomasDarley1
New Contributor II

Having simliar issue with the most recent version, got contractors out now. Pickone with a calculation are all recalculating on loading in a saved to the outbox. Any help would be mcuh apprechiated. 

0 Kudos