Labels for Custom Field Selection Choices #8361

Closed
opened 2025-12-29 20:35:48 +01:00 by adam · 2 comments
Owner

Originally created by @arhamansarii on GitHub (Jul 22, 2023).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.2.2

Feature type

Change to existing functionality

Proposed functionality

Apologies in advance if this issue/feature was discussed previously or addressed in a subsequent Netbox version.

For selection-type custom fields, it would help if we can have the option of adding labels to selection choices. The labels would be human-friendly and appear in the web interface, similar to custom field labels. Meanwhile, the actual value of the selection choice is more database friendly (integer, underscores etc.).

For example, in a Netbox web interface, on a custom field of a device named "SNMP Auth Protocol" of type selection. Users are able to add labels to the selection choices. The labels would be MD5, SHA1, SHA256. The values would be 0, 1, 2 respectively.

If a user chooses selection MD5, the custom field maps MD5 (label) to value of 0.

Use case

This would be useful for accommodating different software API requirements when syncing with Netbox.

For example, our team currently uses Zabbix to monitor devices, where Netbox is source of truth inventory. We sync a lot of values from device custom fields into Zabbix using pynetbox and Zabbix API.

Currently, if I read a custom field value of "MD5" and try passing it into Zabbix API, it will throw an error. That is because MD5 in Zabbix API is represented by a value of "0" instead of "MD5". In this case, a label of "MD5" that maps to a value of "0" would be a useful feature for selection choices. It would prevent us from creating a dictionary to map values in our sync script.

Database changes

No response

External dependencies

No response

Originally created by @arhamansarii on GitHub (Jul 22, 2023). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.2.2 ### Feature type Change to existing functionality ### Proposed functionality Apologies in advance if this issue/feature was discussed previously or addressed in a subsequent Netbox version. For selection-type custom fields, it would help if we can have the option of adding labels to selection choices. The labels would be human-friendly and appear in the web interface, similar to custom field labels. Meanwhile, the actual value of the selection choice is more database friendly (integer, underscores etc.). For example, in a Netbox web interface, on a custom field of a device named "SNMP Auth Protocol" of type selection. Users are able to add labels to the selection choices. The labels would be MD5, SHA1, SHA256. The values would be 0, 1, 2 respectively. If a user chooses selection MD5, the custom field maps MD5 (label) to value of 0. ### Use case This would be useful for accommodating different software API requirements when syncing with Netbox. For example, our team currently uses Zabbix to monitor devices, where Netbox is source of truth inventory. We sync a lot of values from device custom fields into Zabbix using pynetbox and Zabbix API. Currently, if I read a custom field value of "MD5" and try passing it into Zabbix API, it will throw an error. That is because MD5 in Zabbix API is represented by a value of "0" instead of "MD5". In this case, a label of "MD5" that maps to a value of "0" would be a useful feature for selection choices. It would prevent us from creating a dictionary to map values in our sync script. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 20:35:48 +01:00
adam closed this issue 2025-12-29 20:35:48 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 26, 2023):

#12988 introduces custom field choice sets for the upcoming v3.6 release, which makes the proposed functionality much more feasible than the current implementation. IMO if we're going to consider this change, now is the time to do it.

@jeremystretch commented on GitHub (Jul 26, 2023): #12988 introduces custom field choice sets for the upcoming v3.6 release, which makes the proposed functionality much more feasible than the current implementation. IMO if we're going to consider this change, now is the time to do it.
Author
Owner

@jeremystretch commented on GitHub (Jul 26, 2023):

Because this is so closely intertwined with the implementation of #12988 and #12194, I've committed the changes under PR #13219.

@jeremystretch commented on GitHub (Jul 26, 2023): Because this is so closely intertwined with the implementation of #12988 and #12194, I've committed the changes under PR #13219.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8361