Data Connector import rule fails to import blank fields when they are denoted by double quotation marks

Article:TECH148276  |  Created: 2011-01-17  |  Updated: 2013-09-09  |  Article URL http://www.symantec.com/docs/TECH148276
Article Type
Technical Solution


Issue



When an import rule imports records that have blank fields encapsulated by double quotation marks, such as "" or '', the data class is not blanked but contains the quotation marks instead.


Cause



This is working as designed. Data Connector has no pre-processing ability to remove extra values, such as quotation marks, from the value of a CSV file, and does not see this as "remove the current value" therefore.


Solution



Three workarounds exists for this:
 

  1. Use correct CSV formatting for the data source file. Remove all quotation marks that are encapsulating field values. This will then result in an error and skip the row, however, as no value is present to import (refer to TECH202549, below, for more information about why this happens).
  2. Or, add pre-processing to the data source to find and replace the double quotation marks with a null value. The following code demonstrates how this can be done, by using the Initials field for a User resource type when using double "" (this can be changed to '' as necessary):

      for (int i = 0; i < importData.Rows.Count; i++)
      {
        DataRow row = importData.Rows[i];
        if ((string)row["Initials"] == "\"")
        {
          row["Initials"] = System.DBNull.Value;
        }
      }
      return importData;


Related Articles

Data Connector import rule fails to remove a specific column's existing value when it is set to be blank
http://www.symantec.com/business/support/index?page=content&id=TECH202549 

How to troubleshoot import issues when using a Data Connector import rule
http://www.symantec.com/business/support/index?page=content&id=TECH195835

 




Article URL http://www.symantec.com/docs/TECH148276


Terms of use for this information are found in Legal Notices