# How to define default value in field type (not in options)

**URL:** <https://discourse.getcockpit.com/t/how-to-define-default-value-in-field-type-not-in-options/1796>\
**Category:** Support\
**Created:** [January 18, 2021, 8:25pm UTC](https://discourse.getcockpit.com/t/how-to-define-default-value-in-field-type-not-in-options/1796 "2021-01-18T20:25:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcoDaniels](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/marcodaniels/32/755_2.png) [@MarcoDaniels](https://discourse.getcockpit.com/u/MarcoDaniels)\
**Post date:** [January 18, 2021, 8:25pm UTC](https://discourse.getcockpit.com/t/how-to-define-default-value-in-field-type-not-in-options/1796/1 "2021-01-18T20:25:22Z")

</div>

I understand that we can define a default value in the JSON options, but how exactly can we update the “default” value that is part of the field object type? It seems that it always defaults to empty string.

 ![Screen Shot 2021-01-18 at 9.20.35 PM](https://canada1.discourse-cdn.com/flex030/uploads/getcockpit/original/1X/33ada1fddb006ad2da0ce6f9691a79ea2c03f355.jpeg)

---

<div class="post-metadata">

**Author:** ![serjoscha87](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/serjoscha87/32/151_2.png) [@serjoscha87](https://discourse.getcockpit.com/u/serjoscha87)\
**Post date:** [January 22, 2021, 1:28pm UTC](https://discourse.getcockpit.com/t/how-to-define-default-value-in-field-type-not-in-options/1796/2 "2021-01-22T13:28:58Z")

</div>

most things you put to the json is reflected onto the fields in the resulting form.

See [Collection Field: Email Validation - #2 by serjoscha87](https://discourse.getcockpit.com/t/collection-field-email-validation/1299/2) for detailed information

So you could actually try to set the “value” field. But I’m not sure if this could not cause any torubles. But you can give it a try

---

<div class="post-metadata">

**Author:** ![russellfeeed](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/russellfeeed/32/110_2.png) [@russellfeeed](https://discourse.getcockpit.com/u/russellfeeed)\
**Post date:** [March 8, 2022, 1:55pm UTC](https://discourse.getcockpit.com/t/how-to-define-default-value-in-field-type-not-in-options/1796/3 "2022-03-08T13:55:19Z")

</div>

```auto
{
   "default": "my value"
}

```

worked for me in a HTML field. `default` did not.
