Why does the values mapping not work for me?


Question:

I'm attempting to import a CSV file using the following configuration:

{
 "objects": [
   {
      "query": "SELECT Id, Name FROM Contact",
      "operation": "Insert",
      "externalId": "Name",
      "useValuesMapping" : true
    }
 ]
}

I have created a ValueMapping.csv file and enabled the feature with the useValuesMapping=true parameter, but it doesn't seem to work. What could be the issue?


Answer:

The problem arises from using an incorrect parameter for your specific data transfer scenario. There are two distinct parameters for enabling value mapping, depending on the direction of the data transfer:

  • For csv-to-org transfers, use: useCSVValuesMapping=true
  • For org-to-org transfers, use: useValuesMapping=true

Since you are importing from a CSV, you should adjust your configuration as follows:

{
 "objects": [
   {
      "query": "SELECT Id, Name FROM Contact",
      "operation": "Insert",
      "externalId": "Name",
      "useCSVValuesMapping" : true // This enables mapping of CSV values
    }
 ]
}
Last updated on 20th Apr 2024