Select to view content in your preferred language

Overwriting time question when cycling through repeats

260
8
a month ago
GeorgeClutterbuck
New Contributor III

Using survey123 connect I have created form containing repeats which contain a time field. If I cycle through the repeats once filled out, the time field for all the repeats change to the most recent entry. I've tried using the once( function and changing the bind parameters to manual calculation and this works fine before publishing the survey on desktop, but the error perists on the field app and post submission. Any thoughts?

Thanks.

0 Kudos
8 Replies
PanGIS
by
Regular Contributor

I am struggling on the same, finger crossed I managed.

I would say that depends on the type of calculation, one solution does not fit all.

Have you tried to use "calculationMode=whenEmpty"

0 Kudos
GeorgeClutterbuck
New Contributor III

yeah tried that, looked fine on the desktop but then wrong on the field app, frustrating.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Wrap it in once() works well for me

0 Kudos
GeorgeClutterbuck
New Contributor III

did you just do once(now()) for the calculation and it was fine? or did you set the parameters field to manual also? I saw your previous response to a similar post.

0 Kudos
DougBrowning
MVP Esteemed Contributor

I have been using just once(now()) for years before the calculation modes were added.  So far been ok.

0 Kudos
abureaux
MVP Regular Contributor

I literally just had this come up after no issues. Will be trying once() myself (as @DougBrowning suggested).

RobertAnderson3
MVP Regular Contributor

once() is definitely a good solution, I've been liking calculationMode=whenEmpty for calculations as well.

If you're just looking for it to capture now(), could you put it in the default column instead of the calculation column? 

MatthewDesjardins
New Contributor II

I am experiencing something similar, but I'm not sure if it's the same. For me, the issue occurs even if I'm not trying to use a default value, so a once(now()) doesn't seem to be relevant. Even if I do use that, or use calculationMode=whenEmpty, the same thing happens when the user manually enters a value.

In particular, the issue is that when you manually enter a time on the second repeat entry, if you page back to the first one it looks correct at first, but its value has actually changed if you try to submit it now; once you go back to the second and then return to the first again, it shows the same value as the second entry.

For me, it seems to happen with both time and dateTime questions, but not date questions.

However, the survey seems to work as expected when using the web app, as well as using a mobile application (I've only tested it on an iPad). But using the Windows Survey123 application, it behaves the exact same as Survey123 Connect does, with the time question being updated with the later repeat values.

Survey123 Connect is version 3.19.116, and Survey123 is version 3.19.121.


Edit: I tried it with a very simple form just containing these lines and no calculations. I also tried setting calculationMode to either manual or whenEmpty, despite there being no calculation being done, but it behaves the same.

typenamelabel
begin repeatTestRepeatTest Repeat
timeTestTimeTest Time
end repeat  
0 Kudos