Import CSV Data with Custom Field error no valid choise #7251

Closed
opened 2025-12-29 20:20:53 +01:00 by adam · 4 comments
Owner

Originally created by @mrrossi-68 on GitHub (Nov 17, 2022).

NetBox version

v3.3.7

Python version

3.10

Steps to Reproduce

  1. Go to section Virtualization > CLUSTERS > Clusters Type and click "+Add"
  2. Add new Cluster Type. Name*: vmware, Slug*: vmware and click "Create"
  3. Go to section Virtualization > CLUSTERS > Clusters and click "+Add"
  4. Add new Cluster. Name*:cluster01, Type*: vmware, Status: Active
  5. Go to section Other > Custom Fields and click "+Add"
  6. Add new Custom Field. Models(): IPAM>Prefix, Name: Custom_Field_Cluster, Type: Object, Object Type: Virtualization>Cluster
  7. Go to section IPAM > PREFIXES >PREFIXES and click"Import"
  8. Copy and paste this record to import:
    prefix,status,cf_Custom_Field_Cluster
    192.168.1.0/24,active,cluster01
  9. Click Submit

Expected Behavior

Created a new record in the prefixes: prefix 192.168.1.0/24 with the desired custom field cf_Custom_Field_Cluster=cluster01

Observed Behavior

Error inserting. Row 1 cf_Custom_Field_Cluster: Select a valid choice. That choice is not one of the available choices.

If in the CSV Data, entry a value the cf_Custom_Field_Cluster field with the value of the Cluster>ID field instead of Cluster>Name then it works, like in the example below:
prefix,status,cf_Custom_Field_Cluster
192.168.1.0/24,active,1
Click Submit

Originally created by @mrrossi-68 on GitHub (Nov 17, 2022). ### NetBox version v3.3.7 ### Python version 3.10 ### Steps to Reproduce 1. Go to section Virtualization > CLUSTERS > Clusters Type and click "+Add" 2. Add new Cluster Type. Name*: vmware, Slug*: vmware and click "Create" 3. Go to section Virtualization > CLUSTERS > Clusters and click "+Add" 4. Add new Cluster. Name*:cluster01, Type*: vmware, Status: Active 5. Go to section Other > Custom Fields and click "+Add" 6. Add new Custom Field. Models(*): IPAM>Prefix, Name: Custom_Field_Cluster, Type*: Object, Object Type: Virtualization>Cluster 6. Go to section IPAM > PREFIXES >PREFIXES and click"Import" 7. Copy and paste this record to import: prefix,status,cf_Custom_Field_Cluster 192.168.1.0/24,active,cluster01 8. Click Submit ### Expected Behavior Created a new record in the prefixes: prefix 192.168.1.0/24 with the desired custom field cf_Custom_Field_Cluster=cluster01 ### Observed Behavior Error inserting. Row 1 cf_Custom_Field_Cluster: Select a valid choice. That choice is not one of the available choices. If in the CSV Data, entry a value the cf_Custom_Field_Cluster field with the value of the Cluster>ID field instead of Cluster>Name then it works, like in the example below: prefix,status,cf_Custom_Field_Cluster 192.168.1.0/24,active,1 Click Submit
adam closed this issue 2025-12-29 20:20:53 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 17, 2022):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

@jeremystretch commented on GitHub (Nov 17, 2022): Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.
Author
Owner

@mrrossi-68 commented on GitHub (Nov 17, 2022):

I verified the malfunction on the installation on my pc.
I also recreated the environment on the netbox demo version https://demo.netbox.dev/
I created the Custom Field "Location", usable on IPAM > IP Address and I defined as Select Object type DCIM > rack
If you try to import the following CSV Data, the error "Row 1 cf_Location: Select a valid choice. That choice is not one of the available choices."

address,status,cf_Location
192.168.107.253/24,active,R307

If you try to enter the value of ID field of the Rack R307 record >> 36, the entry is successful. When you view the record relating to the ip 192.168.107.253 you can see that the value Location R307 has been entered

address,status,cf_Location
192.168.107.253/24,active,36

@mrrossi-68 commented on GitHub (Nov 17, 2022): I verified the malfunction on the installation on my pc. I also recreated the environment on the netbox demo version https://demo.netbox.dev/ I created the Custom Field "Location", usable on IPAM > IP Address and I defined as Select Object type DCIM > rack If you try to import the following CSV Data, the error "Row 1 cf_Location: Select a valid choice. That choice is not one of the available choices." address,status,cf_Location 192.168.107.253/24,active,R307 If you try to enter the value of ID field of the Rack R307 record >> 36, the entry is successful. When you view the record relating to the ip 192.168.107.253 you can see that the value Location R307 has been entered address,status,cf_Location 192.168.107.253/24,active,36
Author
Owner

@mrrossi-68 commented on GitHub (Nov 20, 2022):

Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports.

Hi, I've updated/revised the first post to include all the detailed steps to exactly reproduce the problem I'm having on a clean empty netbox install.

@mrrossi-68 commented on GitHub (Nov 20, 2022): > Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports. Hi, I've updated/revised the first post to include all the detailed steps to exactly reproduce the problem I'm having on a clean empty netbox install.
Author
Owner

@jeremystretch commented on GitHub (Nov 21, 2022):

If in the CSV Data, entry a value the cf_Custom_Field_Cluster field with the value of the Cluster>ID field instead of Cluster>Name then it works

Yes, this is the correct way to specify related objects. Specifying related objects by name is not supported.

@jeremystretch commented on GitHub (Nov 21, 2022): > If in the CSV Data, entry a value the cf_Custom_Field_Cluster field with the value of the Cluster>ID field instead of Cluster>Name then it works Yes, this is the correct way to specify related objects. Specifying related objects by name is not supported.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7251