[Solved] Error when importing CSV
I’m getting the following error when importing a csv-file:
Unable to bind to type: System.Collections.Generic.List`1[CloudPanel.Base.Models.ViewModels.UserImportViewModel]
The file is using “,” as separator and is saved as Unicode.
Can you please send the logs to support@knowmoreit.com? Also it may be helpful for you to send the CSV file as well but you may want to remove the password values
Johan,
After looking at the logs you sent and the CSV file you sent the reason it failed is because you have the word FALSE in columns such as ?Email? and ?MailboxPlan?.
I don?t know why you put the word FALSE in those columns but you need to take them out. If you don?t want it to have a value then just leave blank.
The Word false is only in the column for “ChangePasswordNextLogin”
and according to the documentation that is a valid value.
I noticed though that I had an incorrect entry in the mailbox-database column
I didn’t mean ChangePasswordNextLogin.. I modified my post after I posted it.
Excel was changing the values to FALSE for some reason. Either way when I look at your document i’m getting strange results. I’m seeing phone numbers in the Street column, i’m seeing some postal codes in the Country column and so on. I’m also seeing two additional columns at the end without the title.
You may want to open that CSV in Excel that you sent me and take a look. I’m emailing you pictures of what i’m looking at.
Did you get my last email with pictures showing you what I was seeing in the CSV?
The pictures you sent doesn’t match what I’m seeing when I open the files on my end.
When I open the files all columns contain the correct information.
Could it have something to do with me using a swedish Excel?
It could be. Did you set Excel to use a comma as the separator or did you manually modify it after the fact?
I think I’ve found an explanation for the displaced columns.
There are information in one column (Department) which contains a comma as a separator between two different departments.
Would it be possible to get cloudpanel to read semicolon as a separator?
We could tweak the javascript to support semicolons. We would have to put that in a newer version though. If you leave out the comma does it import correctly?
After removing the “incorrect” commas the file imported successfully.
A couple of issues though:
1. I had specified Sweden in the country column. When importing the file I got this error:
CloudPanel.Modules.UsersImportModule — Error parsing country Sweden: System.ArgumentException: Culture name ‘Sweden’ is not supported.
What’s the correct way of entering country?
2. How do you handle email aliases in the csv-file?
This is from the documentation:
EmailAliases Commas seperated list of email aliases to add to the user
If you use a comma to separate the aliases, won’t that mess upp the csv-file?
Johan,
The correct way is to put quotes around the columns with commas. If you do all of this in Excel and save it as a CSV it should format it all correct for you. This is what i’m talking about:
DisplayName,Email,EmailAliases
Jacob Dixon,jdixon@knowmoreit.com,”jacob@knowmoreit.com,jdixon@knowmoreit.net”
That works fine when I tested it. Did you save as CSV or did you manually enter this information?
No I haven’t but I’ll try it the next time I’ll do an export.
Did you see the question regarding country?
Johan,
You should use the name of the country specified by the system CloudPanel is installed on or you can use the two-letter code that is defined in ISO 3166: https://en.wikipedia.org/wiki/ISO_3166
- 5 Forums
- 714 Topics
- 3,630 Posts
- 2 Online
- 254 Members