You can automatically capture how long a user spends on a form by using two timestamp variables along with built‑in REDCap action tags. This approach works for both instruments and surveys. If you want to track time on multiple forms, each form must have its own pair of variables.
[form_load_ts]
This variable records the time when the instrument is first loaded.
@NOW-SERVER @READONLY
[form_save_ts]
This variable captures the time of the first save for the instrument. The calculation relies on the form’s completion status, which allows you to control when the timestamp is set. This is particularly useful for surveys, where you don’t want to record a save time until all required fields are completed and the form is marked complete.
@CALCDATE( if(([form_1_complete] >= 0 and [form_save_ts] = ''), 'now', [form_save_ts]), 0,'d')
Make sure the calculation references the correct completion field (e.g., [demographics_complete]) for the instrument where this variable is defined.
With both timestamps in place: