Custom Field UI visibility option "Hidden if unset" #8053

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

Originally created by @eric-eisenhart on GitHub (May 13, 2023).

Originally assigned to: @abhi1693 on GitHub.

NetBox version

v3.5.1

Feature type

Change to existing functionality

Proposed functionality

On the custom-fields edit page, add "Hidden if unset" option to the "UI visibility" selection, and on the object view page, if that's set on definition of a custom field and the field is unset hide that custom field (instead of showing -).

Use case

We have devices managed by a few groups with different needs, and we're using custom fields to help with some of that. This would keep the display of a device (or virtual-machine) cleaner when custom fields aren't used on a specific device.

Use cases are similar to #12423, but I suspect the code would be much simpler.

Database changes

No response

External dependencies

No response

Originally created by @eric-eisenhart on GitHub (May 13, 2023). Originally assigned to: @abhi1693 on GitHub. ### NetBox version v3.5.1 ### Feature type Change to existing functionality ### Proposed functionality On the custom-fields edit page, add "Hidden if unset" option to the "UI visibility" selection, and on the object view page, if that's set on definition of a custom field _and_ the field is unset hide that custom field (instead of showing `-`). ### Use case We have devices managed by a few groups with different needs, and we're using custom fields to help with some of that. This would keep the display of a device (or virtual-machine) cleaner when custom fields aren't used on a specific device. Use cases are similar to #12423, but I suspect the code would be much simpler. ### Database changes _No response_ ### External dependencies _No response_
adam added the status: acceptedtype: feature labels 2025-12-29 20:31:45 +01:00
adam closed this issue 2025-12-29 20:31:45 +01:00
Author
Owner

@gabrielat commented on GitHub (Jun 6, 2023):

Hello! Is it possible to enable this feature in Custom Links too? I have a custom link that calls a custom field and it is useless if the custom field is not set.

@gabrielat commented on GitHub (Jun 6, 2023): Hello! Is it possible to enable this feature in Custom Links too? I have a custom link that calls a custom field and it is useless if the custom field is not set.
Author
Owner

@jeremystretch commented on GitHub (Jun 7, 2023):

@gabrielat custom links which do not render a text value will be hidden. You can simply craft your links to not display any text if the custom field is empty.

@jeremystretch commented on GitHub (Jun 7, 2023): @gabrielat custom links which do not render a text value will be hidden. You can simply craft your links to not display any text if the custom field is empty.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8053