netbox icon indicating copy to clipboard operation
netbox copied to clipboard

Integer field "null" value sorting

Open loubladi opened this issue 8 months ago • 2 comments

NetBox version

v4.2.8

Feature type

Change to existing functionality

Proposed functionality

Currently sorting of numeric fields puts "null" value field first. Proposed functionality would put "null" values last.

Use case

We have created Integer Custom Field "PoP ID" where we store value of Site. But since we need to keep track of many sites, only fraction of Sites have this field filled. When we want to sort sites by this field we have to go through many pages of empty values (i could be done by filtering, but for many users sort is more convenient).

Image

Database changes

None

External dependencies

None

loubladi avatar May 07 '25 08:05 loubladi

What specific change(s) are you proposing? Is this specifically for integer custom fields, or elsewhere?

jeremystretch avatar May 07 '25 12:05 jeremystretch

I propose changing the sorting behavior so that entries with null values appear at the end, while fields with actual values appear first.

My current use case involves a Custom Field with integer values, but I believe this behavior could be beneficial for all numeric sorting in NetBox.

Ideally, this could be implemented as a configuration option in configuration.py, allowing administrators to choose how null values are handled during sorting.

loubladi avatar May 07 '25 13:05 loubladi