-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Field Choice Set Bulk Import error "Nested arrays must have same length" #13983
Comments
The root issue here is that each choice value is being interpreted as an array, such that e.g. I'm not sure we have a great option for handling nested arrays in CSV data, but we should seek to support them when expressed via JSON/YAML. |
I ran into a similar requirement recently in a plugin I was working on and defining the field like below on the field = SimpleArrayField(
base_field=SimpleArrayField(
base_field=CharField(),
min_length=2,
max_length=2,
),
delimiter=';',
required=False,
help_text=_('Semicolon-separated list of comma-separated pairs, encased with double quotes (e.g. "value1,Label 1;value2,Label 2")'),
) |
Actually just using a comma-separated string for nested items works. in the example given, changing it to the following should work:
|
NetBox version
v3.6.3
Python version
3.10
Steps to Reproduce
CSV:
JSON:
YAML:
Expected Behavior
It is expected to create the cusotm field choices
Observed Behavior
Returns this error in all cases: Record 1 extra_choices: Nested arrays must have the same length.
The text was updated successfully, but these errors were encountered: