Create a button in odk forms to get time stamp upon press

i am creating a attendance base small form which will be capable to get geopint along with checkin and checkout time buttons which will get time upon pressing.

i am using the Enketo services and ODK collect as mobile application

i did not found any solution to fix it

Try this:

timestampbutton.xls (5.5 KB)

It uses a trigger as a button to capture a timestamp. Note, because you can keep pressing a trigger on and off, I've added logic to only capture the timestamp the first time its pressed.

1 Like

Thanks alot for sharing this it serves the purpose but can you please guide me it shows the label " OK" on button can i change it as " check in" for 1 button and " check out" for other button to get time

1 Like

I dont beleive the trigger control (at least as implemented by Enketo and Collect) allows you to specify custom text for the button. @martijnr is that correct? [you could probably make an argument that the user-specified control label should become the label on the button...]

1 Like

I don't believe the trigger control (at least as implemented by Enketo and Collect) allows you to specify custom text for the button.

Yes, that's right. This thread is probably the first time I've seen a use case for the proper trigger (that we didn't implement).

I think you could do exactly the same with a select_one though and this would allow you to customize the 'OK' text (as well as the value to set).

1 Like

Using (abusing?) a select_one with a single option to mimic a trigger.... Absolutely Brilliant! :star_struck:

Updated form:
timestampbutton2.xls (5.5 KB)

Heck, you could even go crazy and toss in a button image (see https://docs.opendatakit.org/form-question-types/#select-widget-with-compact-image-options)

checkin

3 Likes

brilliant excellent. job done perfectly fulfill my requirement

thanks to everyone for helping me in minimum time.