Hi,
I'm creating a survey123 form using survey123connect (3.4 beta) and I need to be able to drill down into seconds as an option for data entry in a time field. As default the user can only select the hours and minutes for a time field and I can't find anyway of changing this. Does anyone know if this is possible?
thanks
Hi,
Seconds capture is not directly supported. It is possible to have a form with:
1) A Time/DateTime question to record information to the minute
2) An integer field to record the seconds
3) A calculate question that adds the first to questions together
- If using a time question (which stores text), use concat() to add it to the time string
- If using a datetime question, add (# of seconds*1000) to the datetime question
Hello James,
Is this feature still unsupported? Many natural and wildlife surveys need seconds and it would be very helpful to have in one location
Hi,
We were trying to find a way to use the seconds value from a datetime for other use (concatenate into another value) and thought you may find this useful. The simplest method was to use the scripts component accessible in Connect and then added the pulldata functionality to acquire the seconds from the script.
function getSeconds() {
const padL = (nr, len = 2, chr = `0`) => `${nr}`.padStart(2, chr);
var currentDateTime = new Date( now() );
var resultInSeconds=padL(currentDateTime.getSeconds());
return `${resultInSeconds}`;
}
This is really cool -- Do you just add the seconds to the UTC time recorded by Survey123? I'm trying to do a start time/end time field so I can calculate elapsed times, but I'm only getting minutes so I'm going to try to use your script to incorporate seconds.
I second FRSadmin's comment - it would be very beneficial to have seconds and milliseconds included in the DateTime question type.
Thanks!