The profile_checkboxes module allows you to display "selection" profile fields as checkboxes, and store multiple values in the database. User import handles this fine if you csv file is formatted like so:

"username","firstname","surname","interests"\n
"johndoe","john","doe","Football, Baskeball, Technology"\,

I have attached a patch that allows you to map csv columns to profile selection allowed values and therefore format your csv file like this:

"username","firstname","surname","Football","Basketball","Technology","Dancing"\n
"johndoe","john","doe","1","1","1","0"\n

Comments

mstrelan’s picture

Turns out profile_checkboxes is a little more sensitive with whitespace than I thought. Reroll attached

mstrelan’s picture

Or even better we don't actually need to replace the \n just the \r

harriha’s picture

StatusFileSize
new1.13 KB

It seems that profile_checkboxes has changed a bit lately, and thus integration with user_import has to be done bit differently (profile_checkboxes version 6.x-2.0). Attached is the hack I needed to do in order to enable mapping value of form "value1, value2, value3" to a profile field which uses profile_checkboxes functionality. Just quick and dirty solution to get things done, looks like it could be done more nicely in the latest user_import beta version (6.x-3.0-beta2), in similar fashion as the Date field serialization.

gisle’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Support for fields from contributed projects should be done by implementing hook_field_user_import_supported_alter() in the project that implements the field, not by adding bloat to this project.

Also, it has been a while. Closing as outdated.