<html><body><div style="font-family: 'verdana'; font-size: 12px; color: #000;"><br>
<p>Dear QGIS User Community,<br><br>On QGIS 3.40.14 (LTR) I have a layer with an attribute field (e.g. <code>"Kartierer"</code>). The field has a default value expression set to: <code>@username_phone</code></p>
<p>The field is configured as:</p>
<ul>
<li>NOT <code>NULL</code> constraint enabled</li>
<li>Not empty constraint enabled</li>
</ul>
<p>When I:</p>
<ol>
<li>Open the attribute form</li>
<li>Set default value at @username_phone</li>
<li>Save and Close the form</li>
<li>Reopen the attribute form</li>
<li>The value of the field <code>@username_phone</code> is set back to <code>NULL</code></li>
</ol>
<p>This happens every time the attribute form is reopened.</p>
<p><code>@username_phone</code> is not defined as a variable in QGIS but in QField. If I define <code>@username_phone</code> manually in QGIS Desktop -> The value is filled with my Name (because I set it as default value).</p>
<p>But this defeats the purpose, because, the value should remain dynamic. All surveyors (<code>"Kartierer"</code>) define their name as a custom variable in QField and QField sets <code>@username_phone</code> automatically.<br><br><span class="comment-copy" itemprop="text">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?</span> </p>
<div class="js-comment-actions comment-actions"> </div>
<div class="comment-text  js-comment-text-and-form">
<div class="comment-body js-comment-edit-hide"><span class="comment-copy" itemprop="text">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.</span> </div>
<div class="comment-body js-comment-edit-hide" style="font-family: verdana; font-size: 12px; color: #000000;"> </div>
<div class="comment-body js-comment-edit-hide" style="font-family: verdana; font-size: 12px; color: #000000;">I hope you can help me. I didn't get the right response at stack exchange.<br><br>Kind regards<br>Laura</div>
</div>
</div></body></html>