Docs

Import and Export

Custom objects can be imported and exported in bulk like NetBox's own objects, from the Import and Export buttons on a type's list view.

Bulk Import

The Import button requires add permission and accepts CSV, JSON or YAML. Use field names as column headings or keys. Each row creates an object unless it includes an id, which updates an existing object and, on NetBox 4.6.5 and later, also requires change permission.

Values are given as follows:

Field typeValue
text, long text, integer, decimal, date, datetime, color, MAC addressThe value, as typed in the edit form.
booleantrue or false.
JSONA JSON value.
URLThe URL. Its link title goes in a separate <field>_title column.
coordinatesTwo columns, <field>_latitude and <field>_longitude.
arrayThe list as JSON, e.g. "[1, 2, 3]".
selectThe choice's value.
multi-selectThe choices' values, comma-separated, e.g. "red,blue".
objectThe referenced object, identified as described below.
multi-objectThe referenced objects, comma-separated.
tagsTag slugs, comma-separated.

An object or multi-object field identifies the objects it references by a natural identifier, such as a site's or device's name. The plugin uses the first of name, slug, model and identifier that the referenced object type has, preferring one that's unique. If it has none of them, as with most custom objects, use the object's ID.

  • Polymorphic object and multi-object fields can't be imported, and are left out of the import form.
  • Fields whose UI editable setting isn't Yes are left out too, as in NetBox.

Imports are validated like objects created in the edit form, so required fields, validation rules, uniqueness and constraints all apply.

Export

The Export button on a type's list view exports the current view (its visible columns) or all data as CSV. Any export template assigned to the Custom Object Type is listed there too, and can also be used through the REST API. Export templates can also read other types' objects through the custom_objects template variable.

To copy type definitions, rather than objects, between NetBox instances, use portable schema documents.

On this page