Make customfields multiselect choices related #7766

Closed
opened 2025-12-29 20:27:57 +01:00 by adam · 3 comments
Owner

Originally created by @zacho112 on GitHub (Mar 16, 2023).

NetBox version

v3.4.6

Feature type

Change to existing functionality

Proposed functionality

Currently when using the multi-select options in custom-fields, choice options aren't related when first set. Then means you have to build tools outside Netbox to keep values up-to-date.

This is the case for the implementation in eg Nautobot , you can check their demo site out.

Use case

Making multi-select usable and manageable.

Database changes

No response

External dependencies

No response

Originally created by @zacho112 on GitHub (Mar 16, 2023). ### NetBox version v3.4.6 ### Feature type Change to existing functionality ### Proposed functionality Currently when using the multi-select options in custom-fields, choice options aren't related when first set. Then means you have to build tools outside Netbox to keep values up-to-date. This is the case for the implementation in eg Nautobot , you can check their demo site out. ### Use case Making multi-select usable and manageable. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:27:57 +01:00
adam closed this issue 2025-12-29 20:27:57 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 16, 2023):

Multi-select custom fields are intended to store static values for efficiency. To track related objects, please use the custom object field type.

@jeremystretch commented on GitHub (Mar 16, 2023): Multi-select custom fields are intended to store static values for efficiency. To track related objects, please use the [custom object field](https://docs.netbox.dev/en/stable/customization/custom-fields/#custom-object-fields) type.
Author
Owner

@zacho112 commented on GitHub (Mar 16, 2023):

Thanks for the quick reply. But I have a followup question, we have use cases for using custom objects in custom fields. This could eg. be to define interface roles, used in our automation. Currently the best solution is to add tags to the interface named with a key:value.

Fx: Tag: "inteface_role:whatever".

I really hate this idea, because it's ugly, and there's no way for our users to figure out the purpose of these tags. But it get the job done.

We could also add multi-select with objects, and use the tags here, but again, it's not nice either, but it provide more logic for the humans working within Netbox what the purpose of the tag is.

We need this kind of functionality in various places to add extra options used in automation on our objects.

@zacho112 commented on GitHub (Mar 16, 2023): Thanks for the quick reply. But I have a followup question, we have use cases for using custom objects in custom fields. This could eg. be to define interface roles, used in our automation. Currently the best solution is to add tags to the interface named with a key:value. Fx: Tag: "inteface_role:whatever". I really hate this idea, because it's ugly, and there's no way for our users to figure out the purpose of these tags. But it get the job done. We could also add multi-select with objects, and use the tags here, but again, it's not nice either, but it provide more logic for the humans working within Netbox what the purpose of the tag is. We need this kind of functionality in various places to add extra options used in automation on our objects.
Author
Owner

@jeremystretch commented on GitHub (Mar 16, 2023):

The limitation you're hitting is the need to extend the data model beyond the relationships that already exist. This is usually a sign that it's necessary to either extend the core data model, or introduce a new model via a plugin. (Introducing a model solely to hold choices would be a poor design choice, as it would impose significant performance overhead while delivering very limited value: A choice's attribute would be limited to a single value.)

For your specific use case, I'd argue that it would justify a feature request to introduce an interface role model in NetBox core, as this seems to be a fairly common need. Alternatively, you could write a plugin to introduce your own custom model with whatever additional attributes you may need.

@jeremystretch commented on GitHub (Mar 16, 2023): The limitation you're hitting is the need to extend the data model beyond the relationships that already exist. This is usually a sign that it's necessary to either extend the core data model, or introduce a new model via a plugin. (Introducing a model solely to hold choices would be a poor design choice, as it would impose significant performance overhead while delivering very limited value: A choice's attribute would be limited to a single value.) For your specific use case, I'd argue that it would justify a feature request to introduce an interface role model in NetBox core, as this seems to be a fairly common need. Alternatively, you could write a plugin to introduce your own custom model with whatever additional attributes you may need.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7766