# Module settings in PersistentRecord defaults not saving

**URL:** <https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713>\
**Category:** Module Development\
**Created:** [March 28, 2022, 1:27pm UTC](https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713 "2022-03-28T13:27:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sholom\_Ellenbogen](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Sholom\_Ellenbogen](https://forum.inductiveautomation.com/u/Sholom_Ellenbogen)\
**Post date:** [March 28, 2022, 1:27pm UTC](https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713/1 "2022-03-28T13:27:02Z")

</div>

I created a settings page with default values but instead of it saving these values it saves what seem to be cached values from prior module settings.

---

<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:** [March 28, 2022, 3:00pm UTC](https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713/2 "2022-03-28T15:00:20Z")

</div>

You’ll need to share a little more information or code.

Where is this record being created? Edited? Saved?

---

<div class="post-metadata">

**Author:** ![Sholom\_Ellenbogen](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Sholom\_Ellenbogen](https://forum.inductiveautomation.com/u/Sholom_Ellenbogen)\
**Post date:** [March 28, 2022, 3:03pm UTC](https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713/3 "2022-03-28T15:03:07Z")

</div>

I have a GatewayHook class which extends the AbstractGatewayModuleHook which calls the updatePersistentRecords for each record type (I have a few) in its setup. Additionally in the setup I add listeners for update, add, and deleted.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 28, 2022, 3:15pm UTC](https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713/4 "2022-03-28T15:15:38Z")

</div>

Try dropping the table from SQLite manually, then launching your module.

SQLite/our ORM doesn’t handled changing default values well; if you ever set a default in a PersistentRecord on a live system, that default is (basically) encoded forevermore.

---

<div class="post-metadata">

**Author:** ![Sholom\_Ellenbogen](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@Sholom\_Ellenbogen](https://forum.inductiveautomation.com/u/Sholom_Ellenbogen)\
**Post date:** [March 28, 2022, 3:34pm UTC](https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713/5 "2022-03-28T15:34:44Z")

</div>

Could you tell me how I might drop a table from SQLite? I only have the Sample\_SQLite\_Database in my gateway but I can’t find a table that seems to correspond with my records. I can provide images of the code if that will help.

[EDIT] I figured it out and dropped the table. The defaults now work.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 28, 2022, 3:59pm UTC](https://forum.inductiveautomation.com/t/module-settings-in-persistentrecord-defaults-not-saving/57713/6 "2022-03-28T15:59:14Z")

</div>

For posterity, since I wasn’t clear in my first post (my bad!): You’d drop the table your module added from the `config.idb` file in the `data` directory of wherever you installed Ignition, using any external tool that communicates with SQLite dbs.
