Skip to content
Discussion options

You must be logged in to vote

Hey @nklamann,

There’s currently no option in the UI to invert filters directly, but you can still do this by using the same filter parameters that are available in the REST API and applying them as query parameters in the URL.

For example, if you want to show only devices with the Device Role Switch (database ID 4), you can use:
https://netbox_host/dcim/devices/?role_id=4

If instead you want to show all devices except those with the Switch role (database ID 4), you can use the __n (“not”) lookup:
https://netbox_host/dcim/devices/?role_id__n=4

You can then create a “Saved Filter” for the object type DCIM > Device with parameters like:

{
  "role_id__n": [
    "4"
  ]
}

Replace 4 with the I…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jeremystretch
Comment options

Answer selected by nklamann
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants