I have a note field that tells the user the number of minutes that have passed since starting the form. At 3.0 the minutes changed each time I added a repeat - which is what I want. After upgrading to 3.2 the field is no longer updating at all.
Both outside of a repeat
Field 1
Type Name Label Calc
time StartedForm Started at once(now())
Field 2
Type Name Label Calc
note MinsElapsed Minutes Elapsed round(int(now() - ${StartedForm}) div (1000*60),1)
Again this was working great under 3.0 but never updates on 3.2.
Thanks
Hi Doug,
Are you still experiencing this issue? Does it happen on all devices and all OS versions, or just some? Was it working fine in 3.1 release?
Are you opening a new survey collect, or editing an existing survey? Some changes have been made in 3.1 and 3.2 to improve calculations. especially when opening from Inbox or Sent surveys.
Can you attached a copy of your xlsx file so we can take a closer look at the entire form in context as well as the calculations you shared above.
Phil.
Just got 3.3. On iOS Minutes is always 0 now and never changes. Android still gives the initial minutes and never updates just like 3.2. Have not tried connect yet.
Hi Doug,
Thanks for the update and sharing the xlsx form. I am still looking into this and will get back to you in next few days. Sorry for the delay, we have been busy finalising the 3.3 release, so haven't had much time to look in-depth at your issue yet.
Phil.
Hi Doug,
I have had a look at your survey and found the problem of why the minutes are no longer updating automatically when adding a new repeat. The behaviour you were seeing in 3.0 was actually a bug, even though it was working the way you wanted. In 3.1-3.3 we have spent a lot of time fixing the way calculations work and are get recalculated when values changes, especially when it comes to repeats and nested repeat. We fixed a bug where calculations are updating when they shouldn't, ie no value change in the calculation to trigger it, and this is what has stopped your survey working.
Given the calculation is outside the repeat and doesn't reference any question inside the repeat, it should not update as there is no value update to cause a recalculation. To make your survey work the way you want it to, you need to reference a question inside the repeat and add it to the calculation, that way when you add the new repeat record, the values will update and update the minutes since the survey started.
I have modified your test min xlsx form to include a hidden question inside the repeat which has a default value of 0 (see attached). I then modified the question with the minutes calculation outside the repeat to add the value from the question inside repeat, in this case it will add the max value which will always be 0. When you add a new repeat the max value is calculated again, and because of this the other calculation also gets updated. I also add an extra text question with same settings as the note, as that way you can see the re-calculate button and manually clear the value and repopulate it, which you can not do with a note. This is a good way to see if the calculation actually works.
Tested this on iOS, Android and Windows and appears to be working on all platforms with 3.3, using my modified survey.
Phil.
Thanks a lot that worked.
I just ended up doing a if on a field in the repeat with both sides of the if being the same. That way it updates when the user picks a value and when a repeat record is added.
So if(${RepeatField},round(int(now() - ${StartedForm}) div (1000*60),1), round(int(now() - ${StartedForm}) div (1000*60),1))
Thanks again