CSV import error when using .) in header #4685

Closed
opened 2025-12-29 19:19:30 +01:00 by adam · 2 comments
Owner

Originally created by @Mic-Pod on GitHub (Mar 19, 2021).

NetBox version

2.10.5

Python version

3.8

Steps to Reproduce

  1. create Custom field:
    test (test.)

  2. try to import device with this custom field:
    device_role,manufacturer,device_type,status,site,cf_test (test.)
    Server,HPE,"ProLiant DL560 Gen10",active,S1,test

  3. get an error
    Unexpected column header "cf_test (test" found.

  4. change custom field to:
    test (test)

  5. try to import device with this custom field:
    device_role,manufacturer,device_type,status,site,cf_test (test)
    Server,HPE,"ProLiant DL560 Gen10",active,S1,test

  6. it works

Expected Behavior

Importing devices with custom fields with .) worked before.

Observed Behavior

Importing devices with custom fields with .) doesn't work anymore - Unexpected column header "cf_test (test" found.

Originally created by @Mic-Pod on GitHub (Mar 19, 2021). ### NetBox version 2.10.5 ### Python version 3.8 ### Steps to Reproduce 1. create Custom field: test (test.) 2. try to import device with this custom field: device_role,manufacturer,device_type,status,site,cf_test (test.) Server,HPE,"ProLiant DL560 Gen10",active,S1,test 3. get an error Unexpected column header "cf_test (test" found. 4. change custom field to: test (test) 5. try to import device with this custom field: device_role,manufacturer,device_type,status,site,cf_test (test) Server,HPE,"ProLiant DL560 Gen10",active,S1,test 6. it works ### Expected Behavior Importing devices with custom fields with .) worked before. ### Observed Behavior Importing devices with custom fields with .) doesn't work anymore - Unexpected column header "cf_test (test" found.
adam added the type: bug label 2025-12-29 19:19:30 +01:00
adam closed this issue 2025-12-29 19:19:30 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 19, 2021):

This is expected. The CSV import form uses a period to separate a field name from its accessor (e.g. site.name).

You shouldn't be using punctuation in a custom field name to begin with, though: Stick to alphanumeric characters for the field name and specify a separate label for the field if you want to display something more human-friendly.

@jeremystretch commented on GitHub (Mar 19, 2021): This is expected. The CSV import form uses a period to separate a field name from its accessor (e.g. `site.name`). You shouldn't be using punctuation in a custom field name to begin with, though: Stick to alphanumeric characters for the field name and specify a separate label for the field if you want to display something more human-friendly.
Author
Owner

@Mic-Pod commented on GitHub (Mar 20, 2021):

But this is something new. In previous releases imports with .) worked fine. Of course all headers and values are in quotes "". Is there any workaround to use custom field with . in name?

@Mic-Pod commented on GitHub (Mar 20, 2021): But this is something new. In previous releases imports with .) worked fine. Of course all headers and values are in quotes "". Is there any workaround to use custom field with . in name?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4685