Best practice forum (Archived)

Customfield_[shortname] upload when multiselct is used

 
Peter Pappas
Customfield_[shortname] upload when multiselct is used
by Peter Pappas - Sunday, 26 April 2015, 4:31 AM
 

Anyone have any ideas on the format for multi select fields when uploading?

I can not find this in the documentation on the help website.

I can get other custom fields for other types. Multi select fields are not populating with the choices selected. (tried comma separated and just one of the choices with no success.)

Nathan Lewis
Re: Customfield_[shortname] upload when multiselct is used
by Nathan Lewis - Monday, 27 April 2015, 3:46 PM
Group Totara

Hi Peter.

From a quick look at the data that's stored when you use a multi select through the interface, I think it's going to be quite difficult. As far as I'm aware, there's no special code to handle parsing multi select custom field data during upload (but I didn't look thoroughly).

You could try formatting your data like this:

{"47bce5c74f589f4867dbd57e9ca9f808":{"option":"aaa","icon":"","default":1,"delete":0},
"9df62e693988eb4e1e1444ece0578579":{"option":"ccc","icon":"","default":1,"delete":0}}

where "aaa" and "ccc" are the two options you want, the value in "icon":"" needs to contain the icon for that option (you can see these in the course_info_field table), and the hex strings are from the course_info_data_param table, but you won't see them there until you've selected those options for a course using the interface (e.g. create a course, select all multi select options, check the db table, the hex strings are in the order that the options are listed in the multi select).

Obviously this is too complicated for everyday use, but you might be able to do it if you need a one-off upload. Unless I'm mistaken and someone else can suggest a better solution, I suggest you post in the suggested features forum and ask for the upload tool to be improved.

Nathan