Error when importin…
 
Notifications
Clear all

[Solved] Error when importing CSV

14 Posts
2 Users
0 Reactions
14.8 K Views
0
Topic starter

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.

KMI Support 2016-04-22 01:05

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

1 Answer
0

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.

SupportUppsala Topic starter 2016-04-22 03:13

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

KMI Support 2016-04-22 03:23

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.

KMI Support 2016-04-22 04:35

Did you get my last email with pictures showing you what I was seeing in the CSV?

SupportUppsala Topic starter 2016-04-22 05:54

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?

KMI Support 2016-04-22 06:15

It could be. Did you set Excel to use a comma as the separator or did you manually modify it after the fact?

SupportUppsala Topic starter 2016-04-24 00:55

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?

KMI Support 2016-04-25 08:12

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?

SupportUppsala Topic starter 2016-04-25 18:14

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?

KMI Support 2016-04-26 03:12

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?

KMI Support 2016-04-29 04:47

Johan did you try the CSV again like I was showing above?

SupportUppsala Topic starter 2016-05-02 03:47

No I haven’t but I’ll try it the next time I’ll do an export.
Did you see the question regarding country?

KMI Support 2016-05-02 06:22

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

Share: