# Form syntax for setting default field values as current agent?

**URL:** <https://speciforum.org/t/form-syntax-for-setting-default-field-values-as-current-agent/3153>\
**Category:** Get Help\
**Created:** [November 18, 2025, 6:00pm UTC](https://speciforum.org/t/form-syntax-for-setting-default-field-values-as-current-agent/3153 "2025-11-18T18:00:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfshoobs](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/nfshoobs/32/3979_2.png) [@nfshoobs](https://speciforum.org/u/nfshoobs)\
**Post date:** [November 18, 2025, 6:00pm UTC](https://speciforum.org/t/form-syntax-for-setting-default-field-values-as-current-agent/3153/1 "2025-11-18T18:00:16Z")

</div>

Is there form xml for having a form auto-fill the current user’s Agent into an Agent querycombobox on a form? Or is that hard coded for certain fields only?

The desired function would be like that of CreatedBy and ModifiedBy where the current user is input automatically when saving a form, but applied to other fields.

I know you can set default=“your own name” but that would set the default to that name for every user.

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [November 18, 2025, 8:23pm UTC](https://speciforum.org/t/form-syntax-for-setting-default-field-values-as-current-agent/3153/2 "2025-11-18T20:23:21Z")

</div>

Hi @nfshoobs,

This is already possible! You can add in the `initialize` section of the query combo box field definition `default=CURRENT_AGENT`. See the example below:

```auto
<cell type="label" labelfor="3"/>
<cell type="field" id="3" name="agent1" uitype="querycbx" initialize="name=Agent;title=Agent;default=CURRENT_AGENT" isrequired="false"/>

```

 ![Agent1 defaults to current user](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/7/7c7132b0af0e2902f1f69a4c95ecb2d074fa6425.png)

---

<div class="post-metadata">

**Author:** ![nfshoobs](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/nfshoobs/32/3979_2.png) [@nfshoobs](https://speciforum.org/u/nfshoobs)\
**Post date:** [November 18, 2025, 8:34pm UTC](https://speciforum.org/t/form-syntax-for-setting-default-field-values-as-current-agent/3153/3 "2025-11-18T20:34:44Z")

</div>

Nice!! I was hoping this was currently implemented, but couldn’t find reference in the documentation or examples in any of my forms. Thanks for the info!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/1/18a843c97bc32b40e8ad0e035755bc88ffaacaf7.svg) [@system](https://speciforum.org/u/system)\
**Post date:** [November 25, 2025, 8:35pm UTC](https://speciforum.org/t/form-syntax-for-setting-default-field-values-as-current-agent/3153/4 "2025-11-25T20:35:33Z")

</div>

Closed on November 25, 2025, 8:35pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
