Timestamping responses

Hi, developers!

What's the situation on ODK Collect timestamps beyond "start" and "end"?

I've tried various suggestions to get response timing such as a once(now()) calculation only being relevant when the response exists, but these approaches fail, apparently because now() is only evaluated once when filling out a form.

Lognaturel posted in December 2017 about a plan to implement lightweight timestamping -- will that be included in some Collect release in the near future, and perhaps made available in XLSform?

Cheers, Sebastian

Is there any update on this? This would be a really useful feature - among other things for piloting modules' length, and assessing quality of data collection.

1 Like

Apologies for missing your original post, @Sebastian_Therman!

More native support for lightweight timestamping is still ongoing. You can track progress at https://github.com/opendatakit/javarosa/pull/265.

In the mean time, I've realized that similar results can be achieved with a technique I described in Is it possible to set a default value for a decimal question using the calculate column? The idea is to call once(now()) the first time the question you want to time gets a value. Here is a sample form.

As of Aggregate 1.5, it's also possible to gather and receive a log of enumerator activity as a CSV attachment. See https://github.com/opendatakit/docs/pull/649 for a first pass at documentation. Comments and suggestions appreciated!

1 Like

Thank you, Hélenè!

The sample form was exactly what was needed - I had tried combining conditional once(now()) before, but didn't get it to work. This is already a workable solution, though a native function would of course be easier to use.

I was hoping to get ISO8601 timestamps matching those generated by "start" and "end" , such as
My calculation is therefore
if(${name} = '', '', once(format-date-time(now(), "%Y-%m-%eT%H:%M:%S.%3")))
... but the timezone is still missing, however, and format-date-time doesn't recognize the escapes Z or z. This isn't a huge problem, but is there some easy solution?



I don't believe there's currently any way to include timestamp though that does seem useful. I've filed an issue against the XForms spec: https://github.com/opendatakit/xforms-spec/issues/177

Great, thank you for filing the time zone issue for format-date-time!

1 Like

If there is a need, I support adding %Z to produce '+HH:M0' or '-HH' (or 'Z' perhaps).

For GMT times, do we want to accept any of the (all correct) '+00:00', '-00:00', 'Z', '+00', '-00', or have a more predictable output?

However, in the specific format-date() example, I don't actually understand the issue with once(now()), as it should produce the same, right? (temporary link).

1 Like

Yes, once(now()) did produce the desired output with timezone information, like this:
Thank you, Martijn!