Name accessor for location field in device bulk import form may lead to "non-unique value" error #9604

Closed
opened 2025-12-29 21:19:37 +01:00 by adam · 1 comment
Owner

Originally created by @Bapths on GitHub (May 7, 2024).

Deployment Type

Self-hosted

NetBox Version

v4.0.0

Python Version

3.12

Steps to Reproduce

  1. Create a new site, lets call it site1
  2. Create a new site location for site1 called parent_location1
  3. Create a new site location for site1 called parent_location2
  4. Create a new child location for parent_location1 called child_location
  5. Repeat the last step for parent_location2
  6. Go to device bulk import form and try to add a device located in site1, in one of the two child_location

Expected Behavior

There should be an easy way to differentiate child locations with the same name in bulk import forms.

Observed Behavior

An error is raised :

Record 1 location: "child_location" is not a unique value for this field; multiple objects were found 
Originally created by @Bapths on GitHub (May 7, 2024). ### Deployment Type Self-hosted ### NetBox Version v4.0.0 ### Python Version 3.12 ### Steps to Reproduce 1. Create a new site, lets call it `site1` 2. Create a new site location for `site1` called `parent_location1` 3. Create a new site location for `site1` called `parent_location2` 4. Create a new child location for `parent_location1` called `child_location` 5. Repeat the last step for `parent_location2` 6. Go to device bulk import form and try to add a device located in `site1`, in one of the two `child_location` ### Expected Behavior There should be an easy way to differentiate child locations with the same name in bulk import forms. ### Observed Behavior An error is raised : ``` Record 1 location: "child_location" is not a unique value for this field; multiple objects were found ```
adam closed this issue 2025-12-29 21:19:37 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 7, 2024):

This error message is expected when you have multiple locations with the same name. It is a known limitation of the bulk import function. To work around it, you can instead reference the locations by their unique IDs by changing the column header to location.id.

@jeremystretch commented on GitHub (May 7, 2024): This error message is expected when you have multiple locations with the same name. It is a known limitation of the bulk import function. To work around it, you can instead reference the locations by their unique IDs by changing the column header to `location.id`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9604