# Update Collection After Editing Settings

**URL:** https://discourse.getcockpit.com/t/update-collection-after-editing-settings/1768
**Category:** Support
**Created:** [January 5, 2021, 3:10pm UTC](https://discourse.getcockpit.com/t/update-collection-after-editing-settings/1768 "2021-01-05T15:10:42Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![pixelkarma](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pixelkarma/32/748_2.png) [@pixelkarma](https://discourse.getcockpit.com/u/pixelkarma)
#### Post date: [January 6, 2021, 6:39pm UTC](https://discourse.getcockpit.com/t/update-collection-after-editing-settings/1768/4 "2021-01-06T18:39:43Z")

</div>

Well, perhaps this _feature_ should have a toggle switch, in the config, to automatically remove the data when a field is removed. I’m trying to think of an situation where a developer would want data from a deleted field to show in the API. Especially if that field was once protected by permissions—it’s now open for everyone.

I think your comments here were on the right track.

> [@Unique id for collection fields to keep track of renamed or deleted fields](https://discourse.getcockpit.com/t/unique-id-for-collection-fields-to-keep-track-of-renamed-or-deleted-fields/304):
>
> Renaming or deleting a field of a collection doesn’t change existing entries and their values get fetched with each api call. There are a few issues ([#775](https://github.com/agentejo/cockpit/issues/775), [#843](https://github.com/agentejo/cockpit/issues/843) and [#821](https://github.com/agentejo/cockpit/issues/821)) and a [support question](https://discourse.getcockpit.com/t/api-returns-fields-that-have-been-removed-from-collection/150) about this topic. I thought about it again and I think I found a solution. Revisions for collections would be a nice feature, but it would still work without revisions. Each field just needs a unique id and we need a trigger before the collection is updated [here](https://github.com/agentejo/cockpit/blob/next/modules/Collections/bootstrap.php#L61) $this-\>app-\>trigger('collections.update…

---

_[View the full topic](https://discourse.getcockpit.com/t/update-collection-after-editing-settings/1768)._
