-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing Dynamic Custom object filtering using fields set in the current form #11771
Comments
I feel like this would be blocked by a issue we had opened internally recently, let me try and find it. Edit: Would be blocked by #10054 |
@DanSheps - I don't think so. If I understand correctly he just wants to apply query_parameters to the api select based on the object. #10054 seeks to address cases where one api select is filtered by another one. That is he doesn't want the user to be able to filter, he wants to specify a filter when creating the custom field, and that filter is dynamic based on the currently displayed object. Maybe @damo2929 can clarify what the actual intention is. |
I agree; this doesn't seem like it would be blocked by anything. However I'm also not sure the FR provides sufficient detail. I'd like to see a more thorough description of the proposed functionality. |
Maybe I can help clarify because I want the same thing. When creating a Custom Field of type "Object" or "Multiple Objects", add the ability to contextually limit the available objects for selection. The context should be definable on the Custom Field itself and be processed with a logic AND. This functionality exists for netbox default fields. Example: If I add a new rack. By default, if I click the "site" pulldown, ALL sites are listed. If I change the region to "Region 1", only sites nested under region 1 are listed. This gets very difficult when we are talking about say.. interfaces.. If I have 10,000 interfaces defined and have a custom field called "mirror_interface" of type "Multiple Obect" with an Object type of DCIM->Interfaces assigned to DCIM->Interfaces, I may want to restrict the available selections to interfaces on the device I am working with. Or in the SITE the device is in or some other a combination of other filters.. Maybe Only interfaces in a Site that have a specific VLAN on them. As it stands right now, it is just not possible to select the correct interface because there might be 200 ge-0/0/0s listed. IF we had a multi-select field in Custom Fields called "Filter By", and allowed us to select any other data point as an AND match, we could do this. I would offer that the data points selected in "Filter By" should only be applied if the context in which it is being used contains that data point. Custom Field "Test" is applied to Racks and Devices and is of type Object with Object type Interface. "Filter By" is set to "Rack" and "Device". In the pulldown under the Rack object, all interfaces of any device in the rack are listed (Ignoring the device filter). In the pulldown under a Device object, only interfaces on that device are listed (ignoring the rack filter, unless the device is in a rack then it would use both) "As a Netbox User, I need to be able to create custom fields that are populated from data elsewhere in netbox. I need to be able to contextually filter the available choices based upon pre-defined criteria." |
NetBox v3.5 introduced a new selector widget (see #10054) that I think would address the need here pretty easily. We should be able to render custom object fields with the selector widget. However, the widget doesn't yet support the selection of multiple objects: That functionality would need to be added as well. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary. |
Will this feature implemented for custom fields? I would like to have it as well. |
NetBox version
v3.4.3
Feature type
New functionality
Proposed functionality
when creating object custom fields on an object allow setting a dynamic filter field to be set.
example am on virtual machines with a field call build vlan I am linking to vlan. when using the field it shows all vlans and isn't filtered.
whats required is an option when creating the custom field allow me to set a filter that to be set from a field on the current object.
in this case I would like to vfilter vlans that are in the same site as current.site.
however it could be any field thats common between the source and target objects.
Use case
allows more functional use of object and multi-object custom fields by being able to reduce the selection to whats valid and in scope for it's desired use case. in the same way it happens with the native object links.
Database changes
none
External dependencies
none
The text was updated successfully, but these errors were encountered: