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 NULL constraint enabled
  • Not empty constraint enabled

When I:

  1. Open the attribute form
  2. Set default value at @username_phone
  3. Save and Close the form
  4. Reopen the attribute form
  5. The value of the field @username_phone is set back to NULL

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? 

 
I looked for a suitable existing variable in QField, but even when logged in to QField Cloud, only “mobile” and “mobile user” are stored under user_full_name and user_account_name, not the actual account name. 
 
I hope you can help me. I didn't get the right response at stack exchange.

Kind regards
Laura
_______________________________________________
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

Reply via email to