I built a python init attribute form solution to capture the moment the form gets closed and write that datetime value to a field. However, then i learned python is not supported in Qfield. So is there another way to capture the datetime when a form is closed and write it to a attribute field?
I can set the field to a default value of to_string(format_date(now(),‘yyyy-MM-dd HH:mm:ss+t’)) AND set it to “apply default values on update” but that only works when i change something on the form. If i am mapping the same type of object repeatedly then i use the ‘remember last value’ function, i get to the object, open a new form and hit enter and i am done. In such a fast mapping case, since i change nothing on my form, the “form start” and “form end” fields will have the same timestamp in this case.
-
it would be great if there was python support in QFIeld but i imagine that is easier suggested than done.
-
instead of only offering “apply default values on update” …it would be great to include other event patterns “set once on load”, “apply on close/enter”, ( but that would be a QGIS enhancement i guess. )
Imported from GitHub discussion by @r3tlove on 2023-07-08T21:13:47Z