Dear QGIS User Community,
On QGIS 3.40.14 (LTR) I have a layer with an attribute field (e.g. "Kartierer"). The field has a default value _expression_ set to: @username_phone
The field is configured as:
- NOT
NULLconstraint enabled - Not empty constraint enabled
When I:
- Open the attribute form
- Set default value at @username_phone
- Save and Close the form
- Reopen the attribute form
- The value of the field
@username_phoneis set back toNULL
This happens every time the attribute form is reopened.
@username_phone is not defined as a variable in QGIS but in QField. If I define @username_phone manually in QGIS Desktop -> The value is filled with my Name (because I set it as default value).
But this defeats the purpose, because, the value should remain dynamic. All surveyors ("Kartierer") define their name as a custom variable in QField and QField sets @username_phone automatically.
The field has existed for a long time and has always worked without any issues so far. Even when the variable did not exist in QGIS, the default value _expression_ still contained @username_phone the next time opening the attribute form. My colleague is using QGIS 3.40.13 and does not experience this problem at all. Therefore, it appears to be a recently introduced issue, not a configuration or data‑type problem that has always been present. Is there an alternative way to automatically fill in a field with the name of the surveyor? When @... doesn't work anymore?
_______________________________________________ QGIS-User mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-user Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Kind regards
Laura