Deleting a select custom field doesn't delete options

Hey everyone,

I’m dynamically registering custom fields of single or multi select type by using its API and that part works great. Then I add its options one by one with create custom field option for apps. That part also works (though it could use a bulk create of some sorts or at least a Retry-After header on 429 response).

However, when I unregister (remove) that module, its options aren’t being deleted. Meaning, if a new field is created with the same name, it will already have options available from the previously created and deleted field.

Is this expected behaviour? Shouldn’t deleting a field (and it’s deleted as it doesn’t exist anymore or at least can’t be found by any API call) also delete its options?

I know some of these problems can be solved by adding a timestamp or something similar to the custom field name but I’d rather have clean names if possible.

Thanks in advance!

1 Like

Hello @ChupaCabra,

The options are not bound to the field name, but rather to the key of the custom field module. If you want fresh data for your field, change the module key.

Hope this helps.

1 Like

Hey, sorry for the late reply, I got caught up in trying it out :slight_smile:

Anyways, thanks for the tip, it’s working as it should now.

1 Like