import Custom Fields to user
I have created a few custom fields for user, I can import basic data to users by the default import function or "Admin Data" module, but how can I import data to custom fields?
Hello, that's a great question: at the moment the importer does not handle this, but we could look at it. I wonder if
's Data Admin module does this. Sandra? Thanks! Ross.
edited February 2018
The Data Admin module can help with importing custom field data, with a little bit of setup. Because each school will have different custom fields you'll need to create a Custom Import for your data. Luckily there's no code to write, just a text file to edit.
I've attached a sample Import file to this post (zipped). This can be unzipped and placed in the
folder (create the folder if it doesn't exist). This is the default location, the exact folder is set in Data Admin Settings:
Once added you'll see the new type of import show up in the list:
From here, you can edit the
file and you'll see a structure for the import. The only parts you'd need to change are the Example 1, Example 2, and Example 3 sections: you can edit and copy/paste these to add any number of fields to your import. The
in this file should exactly match the Name field in Gibbon:
For the most part the
can be left unchanged (except the
part which can be set to false). Also the yml format is particular about the indentation, so use four spaces to indent, and any parts you add above
should match the same indentation as the examples.
Hope this helps! Give a shout with any questions. It may sound like a lot of setup, but if you have a fair amount of custom fields to import it's worth it.
Do I have to serialize all custom fields in the last
column? I prepared a .yml file using your template and I am trying to import the custom field data of my users with Data Admin module but it is being impossible =(
I wonder if the module is serializing the information for me.
Does this error tells something to you?
Thanks a lot!
Yep, it handles the serialization for you (and will merge new custom field data with any existing data). For the Custom Fields column, select [ Custom Value ] and then leave it blank. The updater will fill in the exact value as it runs. If that doesn't work feel free to share the .yml for the custom import you've created and I'd be happy to take a look.
Well, I debugged and reached to the conclusion that I was setting the column
to [ Skip this column ] and such was ruining the serialization. I solved it by adding an empty row of Custom Fields to the .csv and it did the trick.
Thanks a lot for the prompt response! =D