# Can I set defaults in a PersistantRecord depandent on one of the fields?

**URL:** <https://forum.inductiveautomation.com/t/can-i-set-defaults-in-a-persistantrecord-depandent-on-one-of-the-fields/38485>\
**Category:** Module Development\
**Created:** [September 8, 2020, 6:26pm UTC](https://forum.inductiveautomation.com/t/can-i-set-defaults-in-a-persistantrecord-depandent-on-one-of-the-fields/38485 "2020-09-08T18:26:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [September 8, 2020, 6:26pm UTC](https://forum.inductiveautomation.com/t/can-i-set-defaults-in-a-persistantrecord-depandent-on-one-of-the-fields/38485/1 "2020-09-08T18:26:03Z")

</div>

Hello,

I am trying to configure the following setup.

A user is presented with an enumfield, and they choose a selection.

A series of fields below populate with different default values, dependant on the selection result in enumfield.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 8, 2020, 6:48pm UTC](https://forum.inductiveautomation.com/t/can-i-set-defaults-in-a-persistantrecord-depandent-on-one-of-the-fields/38485/2 "2020-09-08T18:48:58Z")

</div>

No, the defaults for a PersistentRecord are recorded in the static members of the class.

---

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [September 8, 2020, 6:50pm UTC](https://forum.inductiveautomation.com/t/can-i-set-defaults-in-a-persistantrecord-depandent-on-one-of-the-fields/38485/3 "2020-09-08T18:50:56Z")

</div>

Probably will have to use a record listener, hide the visibility and then update the changeable records upon a record change?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 8, 2020, 7:03pm UTC](https://forum.inductiveautomation.com/t/can-i-set-defaults-in-a-persistantrecord-depandent-on-one-of-the-fields/38485/4 "2020-09-08T19:03:14Z")

</div>

If these things can be hidden from the user and derived from some other setting why do they even need to be a part of the settings record?

---

<div class="post-metadata">

**Author:** ![cboin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cboin](https://forum.inductiveautomation.com/u/cboin)\
**Post date:** [September 8, 2020, 7:05pm UTC](https://forum.inductiveautomation.com/t/can-i-set-defaults-in-a-persistantrecord-depandent-on-one-of-the-fields/38485/5 "2020-09-08T19:05:19Z")

</div>

Excellent question. I am currently removing them from the settings record into a class with static variables. No point for them to be in the settings record. Thanks!
