Survey123 DateTime now() theme-grid pages returning wrong output after update

1575
7
Jump to solution
09-29-2021 01:51 AM
DataOfficer
Occasional Contributor III

We have 3-page (Style = theme-grid pages) Survey123 forms built in Connect. On page 3 of the form we have a DateTime question with default set to now() to capture the end date and time of the survey. Until recently, this would only trigger when the user navigated to that particular page. However, it is now grabbing the date/time when the form is first opened. Is this a result of the recent Survey123 updates? And how can we return it back to its previous behaviour?

As an example, the form is opened at 16:13, the user finishes entering data on pages 1 and 2, and then navigates to Page 3 (the end page) at 20:28. The DateTime question on Page 3 should return [DATE] 20:28 but instead is now returning [DATE] 16:13.

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Hi @DataOfficer,

As discussed via the chat, the relevant statement for "end of survey time" is based on two questions that are on page 1 and both of those get valid values at the start of the survey. This means the now() calculation on "end of survey time" gets triggered at the same time as these first two questions. It doesn't matter it is on a different page or group, as the relevance for that question still only relies on those 2 questions being valid.

As suggested by @Agilityzen, another option would be to add an additional relevant statement to the "end of survey time" question which includes a value from a question that is at the end of the survey, just before the date/time question on page 3. This will mean the end time recorded is always set correctly on page 3 when those last few questions are answered and "end of survey time" becomes relevant.

I also tested with 3.12, which was released back in March this year, and with the recent 3.13 release. I see the same issue with both versions, so not related to 3.13 release. The change in behaviour is likely related to something else you changed in the xlsx file recently, maybe related to the groups/pages/grid-theme and/or relevant statements and how they were configured together.

Regards,

Phil.

View solution in original post

0 Kudos
7 Replies
by Anonymous User
Not applicable

Hi @DataOfficer,

Nothing should have changed with 3.13 as to when time calculations get triggered, but there were changes with grid theme that affects groups and repeats and how they operate. This may have had an impact depending how your form is configured.

Are you able to share your XLSForm (xlsx file and media folder) so we can take a closer look?

Regards,

Phil.

DataOfficer
Occasional Contributor III

Sent via Messages.

by Anonymous User
Not applicable

Hi @DataOfficer,

Thanks, have recieved it, will take a look and get back to you.

Phil.

0 Kudos
by Anonymous User
Not applicable

Hi @DataOfficer,

As discussed via the chat, the relevant statement for "end of survey time" is based on two questions that are on page 1 and both of those get valid values at the start of the survey. This means the now() calculation on "end of survey time" gets triggered at the same time as these first two questions. It doesn't matter it is on a different page or group, as the relevance for that question still only relies on those 2 questions being valid.

As suggested by @Agilityzen, another option would be to add an additional relevant statement to the "end of survey time" question which includes a value from a question that is at the end of the survey, just before the date/time question on page 3. This will mean the end time recorded is always set correctly on page 3 when those last few questions are answered and "end of survey time" becomes relevant.

I also tested with 3.12, which was released back in March this year, and with the recent 3.13 release. I see the same issue with both versions, so not related to 3.13 release. The change in behaviour is likely related to something else you changed in the xlsx file recently, maybe related to the groups/pages/grid-theme and/or relevant statements and how they were configured together.

Regards,

Phil.

0 Kudos
Agilityzen
New Contributor

Another option is to add a relevancy statement in your dateTime question where it doesn’t show until you answer a question just before it. It works for me in a survey where I need to capture the time when a coordinate is added through a geopoint. This can be 5, 10, or more minutes after the survey is started.

Chris Anderson

DougBrowning
MVP Esteemed Contributor

May also have to add once().  Sometimes it recalcs on us on edits and shows 256 hours or something like that.

0 Kudos
FredMitchell
New Contributor III

I'm having an issue with now() in the default column also that recently stopped working. I have two survey's that respond to one hosted feature service. One is a request that is submitted in the browser and the other is how inspectors respond to that request using the app. The now() on the DateTime field for the request works but it doesn't work on the inspection side in the Survey123 app. Please let me know if this is a bug or if I have something wrong with my code. Thanks!

0 Kudos