Survey123 calculationMode=whenEmpty Not working

05-17-2023 12:51 PM
New Contributor

I have a survey where the user can change the status, and I am tracking the dateTime of the status change in a hidden field. The problem is when a user changes the status, the dateTime field in reference to the existing status value is set to null when the form is submitted.

The way this is setup is I have a select_one field with my status values.


For each status value, I have hidden dateTime fields with a calculation value of now(), and a relevant value that matches the selected status value.


Once the status has been selected and submitted, I want the dateTime field to calculate and then never change.  From the description of the calculateMode=whenEmpty, I thought this was the correct choice.

However, if I change the status from say 2. to 4., the dateTime value for 2. becomes null, and 4. populates with the now value.

Before changing and submitting:


After changing and submitting, note how 2. is blank:


I've tried other calculateMode values and nothing works.  Any ideas?

Tags (2)
2 Replies
New Contributor

An update:

If I change the input type to dateTime, and make the calculationMode=auto, then the user can click the Recalculate button and submit.  This preserves the values in other date fields, but I would still like the calculation for the new status to automatically calculate.

0 Kudos
New Contributor III


The parameter calculationMode=whenEmpty has now stopped working for me too. It's been working for almost a year. If I turn off readonly it works. I don't want this field to have the ability to be recalculated. If any one has any ideas I'd love to hear them.