I cannot for the life of me figure out how to specify roles for imported users via csv. This issue talks about specifying a column with comma separated values containing roles, but how the heck do you do that when the field separator for the whole file is a comma (CSV...)? I really have several questions:

1) how do you specify a role? is it with the role name, a role id number, or what?
2) how do you specify multiple roles for a user?
3) how do you specify roles that have a space in the name? Would you have to enclose them with quotes?

Here's an example of the sort of info I want to import. Any help would be much appreciated.

organization, first-name, last-name, phone-number, email,            roles
Fun Town,     Jane,       Doe,       1234567890,   jane@example.com, {User Administrator, Office Staff, Supervisor}

Comments

pvanerk’s picture

subscribe

itserich’s picture

need it also

robert castelo’s picture

Status: Active » Fixed

If you look at the sample.txt import file it looks like this:

"First Name","Last Name","Password","Tel","Fax","Email","Blog","Contact"

That's the format you should import with, you can then have a column that includes roles for a user, which if there's more than one should be comma separated: "role 1, role 2".

User Import even has the option to create roles if they don't exist.

timd.mackey’s picture

Great, thanks for your help! I didn't realize that the fields were supposed to be enclosed with quotations, which is why I couldn't figure out how you could have multiple comma separated values in one field. All my tests so far had been with un-quoted fields.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.