Overview
When trying to perform an import with M-Files Importer, you receive the following error sometimesError: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper (IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper (IFormatProvider provider, String format, ParamsArray args)
at System.String.Format (String format, Object arg0)
at MFilesImporter.String2PropertyValue.AddNewValueListItem (MetadataCache cache, Int32 valueListID, String newItemName)
at MFilesImporter.String2PropertyValue.SearchValueListItemsByName (MetadataCache cache, Int32 propDefID, Int32 valueListID, String stringValue, ValueListItemMode mode, Boolean addNew, Boolean mustExist)
at MFilesImporter.String2PropertyValue.GetVLIsByNameOrInternalID (MetadataCache cache, Int32 propDefID, Int32 valueListID, String [] stringValues, Boolean addNew, Boolean mustExist)
at MFilesImporter.String2PropertyValue.ValueList (MetadataCache cache, Int32 propDefID, String [] stringValues, ValueListItemMode mode, Boolean addNew, Boolean mustExist)
at MFilesImporter.String2PropertyValue.GetPropertyValue (MetadataCache cache, String stringValue, Int32 propDefID, Int32 mode, Boolean createNewValueListItems, Boolean mustExist, Char [] separatorCharacters)
at MFilesImporter.Mapping.CreatePropertyValue (MetadataCache cache, String value, Char [] multiValueSeparatorChars)
at MFilesImporter.ObjectBase.AddParsedValueToProperties (String parsedValue, Mapping mapping, PropertyValues propValues, PropertyValues duplicateValues, CollectedIDValues collectedIDValues)
at MFilesImporter.CSV.CSVDataRow.CollectPropertyValuesAndIDs (PropertyValues propValues, PropertyValues duplicateValues, CollectedIDValues collectedIDValues)
at MFilesImporter.ObjectBase.GetImportPropertyValues ()
at MFilesImporter.ObjectCreator.CreateMFilesObjects (ObjectBase objectBase, PropertyValue transmittalPV)
at MFilesImporter.ObjectSourceBase.CreateMFilesObjects (String parentDirectory, ObjectVersion transmittalOV)
--- END 5 ---
Solution
The issue is that whenever you perform an import with the M-Files Importer, you cannot create an object with the Importer from a single point of data. In the below example Department and Function are both object-types. When "VLI Create New" is checked, the Importer tries to create new instances of these objects to the value lists, but objects exist as more than just a single data point. This produces the error above.The solution would be to uncheck the "VLI Create New" option for these properties and not try to use this functionality for properties that point to object types.
NOTE: Please be aware that the M-Files Importer is a tool that is provided *as-is*. This means the tool is provided outside of the standard M-Files Support agreement. If you run into any issues with running the tool, either through learning how the tool needs to run or an error being thrown from the tool, it would need to be addressed through your M-Files Account Manager and the M-Files Services team.
