For selection type custom fields, allow a single option #7167

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

Originally created by @decoupca on GitHub (Oct 26, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.6

Feature type

Change to existing functionality

Proposed functionality

When creating a selection custom field, allow a single option. Currently, selection type custom fields require at least two available options.

Use case

Some scenarios restrict acceptable value to a few choices (not freeform text), but for which there is, at least currently, only one viable option.

For example, I want to assign a named SNMPv3 credential set to devices which I model as a custom field called snmpv3_ro_cred_name. I want to eliminate any possibility of invalid input, so I prefer a selection field over text. But as we only have one valid SNMPv3 credential set defined, I can't use selection field type, which requires at minimum two available options.

Database changes

None

External dependencies

None

Originally created by @decoupca on GitHub (Oct 26, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.6 ### Feature type Change to existing functionality ### Proposed functionality When creating a selection custom field, allow a single option. Currently, selection type custom fields require at least two available options. ### Use case Some scenarios restrict acceptable value to a few choices (not freeform text), but for which there is, at least currently, only one viable option. For example, I want to assign a named SNMPv3 credential set to devices which I model as a custom field called `snmpv3_ro_cred_name`. I want to eliminate any possibility of invalid input, so I prefer a selection field over text. But as we only have one valid SNMPv3 credential set defined, I can't use selection field type, which requires at minimum two available options. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 20:20:02 +01:00
adam closed this issue 2025-12-29 20:20:02 +01:00
Author
Owner

@proudbro commented on GitHub (Nov 18, 2022):

Why don't you use boolean type of cf?

@proudbro commented on GitHub (Nov 18, 2022): Why don't you use boolean type of cf?
Author
Owner

@decoupca commented on GitHub (Nov 18, 2022):

Why don't you use boolean type of cf?

because eventually this cf will have multiple choices, just at this point it only has one.

@decoupca commented on GitHub (Nov 18, 2022): > Why don't you use boolean type of cf? because eventually this cf will have multiple choices, just at this point it only has one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7167