Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
I think your question is answered here: http://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2017/4/csv-import-dictionarymultivalue/
Regards,
/Q
Thanks, but no - the other question I made was in regards to the actual format of the CSV file; it doesn't answer if it's possible for the import to create the values that do not exists.
For example, if I read in a value of "red, blue, green" but only "red" and "blue" are defined in the dictionary - is there any way, any class I can override, any API I can call, or an import to run, that can create the "green" value for me?
Or will it be a manual process for each value?
Thanks in advance.
Ah sorry - read it too fast.
Yes, it's possible to use APIs to create DictionaryMultiValue - you just can't create it with CSV Import.
Here's an example of creating a new metafield of type DictionaryMultiValue, and add Hello and World to it. The APIs are not pretty, but they do the work:
var metaField = MetaField.Create(MetaDataContext.Instance, "", metaFieldName, metaFieldName, "", MetaDataType.DictionaryMultiValue , 10, false, false, false, false); if (!metaField.Dictionary.Contains("Hello")) { metaField.Dictionary.Add(new MetaDictionaryItem("Hello")); } if (!metaField.Dictionary.Contains("World")) { metaField.Dictionary.Add(new MetaDictionaryItem("World")); }
Hi.
Is it possible via the CSV import to create new entries in a DictionaryMultiValue property so the users/editors don't have to create them manually in Commerce Manager before hand themselves?
For example - if we have a ProductColor property which is MultiValue (a product can have multiple colors) and they want to import a new cataloge with new colors, then instead of having to manually create the entrires for all the color variances, having the import do it?