Docs

Custom Object Field Attributes

The following attributes are available when creating or editing a Custom Object Type Field.

Available Field Types

TypeDescription
textShort text
longtextLong text (rendered as a textarea)
integerInteger number
decimalDecimal number
booleanTrue/false
dateDate
datetimeDate and time
urlURL, with an optional link title
jsonArbitrary JSON value
selectSingle selection from a choice set
multiselectMultiple selections from a choice set
objectReference to a single object (built-in NetBox object or Custom Object)
multiobjectReference to multiple objects of the same type
coordinatesA geographic latitude/longitude pair (with a map link)

Common Attributes

AttributeDescription
NameInternal field name. Must be lowercase alphanumeric with underscores only (e.g. rack_unit).
LabelHuman-readable display name shown in the UI. Defaults to the field name.
TypeData type of the field (see above).
DescriptionHelp text shown below the field in forms.
Group nameFields sharing the same group name are displayed together.
RequiredWhen enabled, a value must be provided when creating or editing an object.
Must be uniqueWhen enabled, no two objects of this type may share the same value for this field. Not supported for boolean or multiobject fields.
Primary name fieldWhen enabled, this field's value is used as the object's display name.
Context fieldWhen enabled, this field's value is shown as context when this object is referenced by another object.
DefaultDefault value pre-populated when creating a new object. Must be a valid JSON value.
Display weightControls the field's position in forms and detail views; higher weights appear lower. Default: 100.
Search weightRelevance weight for full-text search. Lower values are more important; 0 disables search indexing for this field. Default: 500.
Filter logicLoose (match any substring), Exact (match whole value), or Disabled. Default: Loose.
UI visibleControls visibility in detail views: Always, If set, or Hidden. Default: Always.
UI editableControls editability in forms: Yes, No (read-only), or Hidden. Default: Yes.
Is cloneableWhen enabled, this field's value is copied when cloning an object.
CommentsFree-form notes about this field (supports Markdown).
DeprecatedMarks the field as read-only; new values cannot be entered. Use during a migration grace period.
Deprecated sincePEP 440 version string indicating the schema version in which the field was deprecated (e.g. 2.0.0).
Scheduled removalPEP 440 version string indicating the schema version in which the field is planned to be removed (e.g. 3.0.0).

Text Fields

Field types: text, longtext

AttributeDescription
Validation regexRegular expression enforced on field values. For example, ^[A-Z]{3}$ limits values to exactly three uppercase letters.

Numeric Fields

Field types: integer, decimal

AttributeDescription
Minimum valueMinimum allowed numeric value.
Maximum valueMaximum allowed numeric value.

Choice Fields

Field types: select, multiselect

AttributeDescription
Choice setA NetBox Custom Field Choice Set that defines the available options. Required.

Object Reference Fields

Field types: object, multiobject

AttributeDescription
Related object typeThe type of object this field references. Used for non-polymorphic fields. May be any built-in NetBox object type or another Custom Object Type.
PolymorphicWhen enabled, the field may reference objects of more than one type (uses a generic foreign key). Cannot be changed after the field is created.
Related object typesFor polymorphic fields, the set of object types that may be referenced. Cannot be changed after the field is created.
Related object filterA JSON query_params dict used to filter the object selection drop-down (e.g. {"status": "active"}).
Reverse relation nameName for the reverse relation accessor on the related object. For example, setting this to ssl_profiles on a Certificate → SLB field allows slb.ssl_profiles.all() in export templates.
On delete behaviorWhat happens when the referenced object is deleted: Set null (clear the field, keep this object), Cascade (delete this object too), or Protect (prevent deletion of the referenced object). Default: Set null. Applies only to object fields, not multiobject.

To reference another Custom Object Type, choose Custom Objects > <Custom Object Type name> in the Related object type dropdown. To create a polymorphic field that may reference objects of multiple types, enable Polymorphic and select the allowed types under Related object types.

Coordinates Fields

Field type: coordinates

A single coordinates field stores a geographic latitude/longitude pair, mirroring NetBox's native Site/Device coordinates (plain decimal columns - PostGIS is not required). Adding one coordinates field named location creates two backing columns and two form inputs:

  • location_latitude - decimal, range −90 to 90, up to 6 decimal places
  • location_longitude - decimal, range −180 to 180, up to 6 decimal places

Behaviour:

  • Both-or-neither. Latitude and longitude must either both be set or both be empty; setting only one is rejected in forms and via the REST API.
  • REST API. The pair is exposed as two flat fields, <name>_latitude and <name>_longitude (matching NetBox core's serializers), not as a nested object.
  • Map link. Detail views render the coordinates with a Map button that opens the location using NetBox's MAPS_URL configuration parameter (Google Maps by default).
  • Must be unique and Default are not supported for coordinates fields.

URL Fields

Field type: url

A url field stores the URL value plus an optional human-readable link title. Adding one url field named website creates two backing columns:

  • website - the URL itself
  • website_title - optional display text shown in place of the raw URL

Behaviour:

  • Detail page and list view. The title, when set, is used as the visible link text both on the object's detail page and in its column in list/table views — the two backing columns are never shown as separate table columns. Falls back to the raw URL as link text when no title is set.
  • Optional independently. The title has no relationship to the URL value — setting one without the other is allowed and harmless.
  • REST API. The pair is exposed as two flat fields, <name> and <name>_title.
  • Must be unique and Default continue to apply to the URL value itself, exactly as for any other url field.
  • CSV import. Bulk CSV import only populates the URL value; the title column is not importable via CSV (the same limitation applies to coordinates fields' backing columns).
  • Upgrading from an older release. Existing url fields gain the <name>_title column automatically on the next manage.py migrate (or immediately via manage.py upgrade_custom_objects) -- this also heals every existing NetBox Branching branch's own schema, not just main's. A branch migrating on its own afterward re-heals itself too, as a secondary safeguard, but isn't required for the column to already be there.

On this page