Time stamp on hidden question

Hi,

I would like to add a hidden question which records the time near the end of an interview, ideally this should be non-editable once the survey has been saved for the first time.

I have set up a yes/no question as the last of the survey, 'Have you completed the survey', and based on that then use a calculate field with 'if(${Finished_YN}='','',once(now()))' to take a time stamp. This assumes that they enumerators will say they are finished and not change the answer at a later stage which will change the time stamp (as occurs with End Time).

I know there are Audit Logs but i do not want something as detailed and i need the end time to pulling into a database with the remainder of the data.

If anyone has any better solutions they have used, please let me know.

Thanks

Hi @Rusti

I think your solution is right and there is no simpler way to do that.

Thanks Grzesiek, does the once() ensure that the time will not change again even if the form is edited?

Yes, according to the doc:

The once() function prevents multiple evaluation by only evaluating the expression passed into it if the node has no value. That means the expression will be evaluated once either on form open or when any values the expression depends on are set.

https://docs.opendatakit.org/form-logic/

1 Like