Render Custom Field Choices as label instead of value in UI #8702

Closed
opened 2025-12-29 20:40:07 +01:00 by adam · 5 comments
Owner

Originally created by @sleepinggenius2 on GitHub (Oct 3, 2023).

Originally assigned to: @sleepinggenius2 on GitHub.

NetBox version

v3.6.3

Feature type

Change to existing functionality

Proposed functionality

When using the new Custom Field Choices, you are able to set a value and a label for each choice. When editing an object with a custom field that uses a Choice Set that has different labels and values like that, the label is shown in the dropdown, but the value is shown in the object view and in the corresponding table column. My proposal is to use the label value for display purposes everywhere in the UI.

Use case

This proposal would bring the Custom Field Choices functionality in line with the native choice fields in how they are rendered in the UI and would provide a cleaner experience to the end users. I feel that this is also in alignment with the original feature request #13241.

Database changes

None

External dependencies

None

Originally created by @sleepinggenius2 on GitHub (Oct 3, 2023). Originally assigned to: @sleepinggenius2 on GitHub. ### NetBox version v3.6.3 ### Feature type Change to existing functionality ### Proposed functionality When using the new Custom Field Choices, you are able to set a value and a label for each choice. When editing an object with a custom field that uses a Choice Set that has different labels and values like that, the label is shown in the dropdown, but the value is shown in the object view and in the corresponding table column. My proposal is to use the label value for display purposes everywhere in the UI. ### Use case This proposal would bring the Custom Field Choices functionality in line with the native choice fields in how they are rendered in the UI and would provide a cleaner experience to the end users. I feel that this is also in alignment with the original feature request #13241. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 20:40:07 +01:00
adam closed this issue 2025-12-29 20:40:07 +01:00
Author
Owner

@stavr666 commented on GitHub (Oct 3, 2023):

Against the idea.

Label - for UI. Value - for APIs. Imho. That's how we use it now: human readable representation of IDs and GUIDs.

@stavr666 commented on GitHub (Oct 3, 2023): Against the idea. Label - for UI. Value - for APIs. Imho. That's how we use it now: human readable representation of IDs and GUIDs.
Author
Owner

@sleepinggenius2 commented on GitHub (Oct 3, 2023):

@stavr666 I'm really confused by your response. You say you're against the idea, but then you say label for UI and value for APIs, which is exactly what I've proposed.

@sleepinggenius2 commented on GitHub (Oct 3, 2023): @stavr666 I'm really confused by your response. You say you're against the idea, but then you say label for UI and value for APIs, which is exactly what I've proposed.
Author
Owner

@jeremystretch commented on GitHub (Oct 3, 2023):

My proposal is to use the label value for display purposes everywhere in the UI.

I agree with this. For example, if you have a choice with the value 00ff00 and the label Green, the user would expect to see the label. Prior to v3.6 this was not a concern because NetBox did not offer support for custom field choice labels.

@jeremystretch commented on GitHub (Oct 3, 2023): > My proposal is to use the label value for display purposes everywhere in the UI. I agree with this. For example, if you have a choice with the value `00ff00` and the label `Green`, the user would expect to see the label. Prior to v3.6 this was not a concern because NetBox did not offer support for custom field choice labels.
Author
Owner

@sleepinggenius2 commented on GitHub (Oct 4, 2023):

I have a solution that seems to work and can submit a PR.

@sleepinggenius2 commented on GitHub (Oct 4, 2023): I have a solution that seems to work and can submit a PR.
Author
Owner

@arthanson commented on GitHub (Oct 4, 2023):

I will assign it to you @sleepinggenius2

@arthanson commented on GitHub (Oct 4, 2023): I will assign it to you @sleepinggenius2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8702