Problem importing codelist

  • Asked
  • Active
  • Viewed 1871 times
0

I need to import a hierarchical codelist but receive this error message: 'Error importing data... row; column; wrong column name'. I am importing it as a zipped CSV.

Any help is appreciated, thanks!

0

Accepted answer

In order to import a codelist you should follow the naming that you gave to the different levels of your hierarchy.

If for instance you have a three-level hierarchy codelist with Category -> Subcategory -> Subdivision

alt text

The the CSV file should have at least 9 columns 1 with code, 1 with label, 1 with description (in case you only have one language set in your survey, i.e. English). You should import the codelist as a CSV rather than a ZIP.

category_code,category_label_en,category_description_en,subcategory_code,subcategory_label_en,subcategory_description_en,subdivision_code,subdivision_label_en,subdivision_description_en
1,1,,,,,,,
1,1,1 desc,1a,a,1a desc,,,
1,1,1 desc,1a,a,1a desc,1a1,1,1a1 desc
1,1,1 desc,1a,a,1a desc,1a2,2,1a2 desc
1,1,1 desc,1b,b,1b desc,,, 
1,1,1 desc,1b,b,1b desc,1b1,1,1b1 desc
1,1,1 desc,1b,b,1b desc,1b2

Thanks, do you mean that I need to create and label each level within Collect under 'code lists' ? I have 11 columns, so I created 11 columns of the same name. However, I am still getting the same error message (row: 1, columns: name, Type: Wrong column name). I am importing as a CSV now.

hcardwell hcardwell
0

Accepted answer

When you export the codelist what do you get? The codelist that you import should look the same than the one you export (I mean the structure)

Before you import anything you need to create the levels of the hierarchical codelist...

I'm not sure what you mean. I can't import the codelist so there is nothing for me to export.

So, I have 11 columns and should create 11 columns within collect to correspond. For example, in the csv the attributes are labelled 'attribute_label', 'attribute_code', 'attribute_description'. Do the names for the levels need to look exactly the same?

hcardwell hcardwell

I understand what you mean now!

The order of the attributes that collect spits out is different from mine. For example, I have '_label', '_code', '_description' but collect shot out '_code', '_label_en', '_description_en'.

hcardwell hcardwell

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Tip: type a few words from the error message, or put a tag in [brackets] to look only there.

Menu

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.