Custom field UI visibility filter enhancement
NetBox version
4.6.8
Feature type
Change to existing functionality
Proposed functionality
Currently when creating a custom field that references an object, the only way to control if that UI element is visible is either through the choices always, if set, or hidden.
New functionality should allow another option for custom fields that reference other objects, where alongside those three choices, a new option for "Custom" is available. Upon selecting Custom, a field for UI visibility filter similar to the related object filter appears, where you should be able to enter in JSON to determine whether or not that field is visible on the object or not.
Use case
Take for example an IP address and a custom field with a type of "Object" and the related object type is "IP Address". If the custom field only applies to IP addresses belonging to a specific tenant, I could specify
{"tenant":"ACME Corp"}
in the UI Visibility filter. This would make it so if the IP address is associated with the ACME Corp tenant, the custom form field is visible. If you are viewing/editing an IP address associated with Vandelay Industries, the custom field is not visible.
Database changes
No response
External dependencies
No response
Source: netbox-community/netbox