Why doesn't FieldMapping rename CSV column headers in my configuration?


Question:

I am using FieldMapping to generate a CSV file with specific column headers for an external target system. My configuration is as follows:

{
   "objects": [
       {
           "query": "SELECT Name from Account",
           "externalId": "Name",
           "operation": "Insert",
           "useFieldMapping": true
       }
   ]
}

I also have a FieldMapping.csv file in the same directory with entries specifying the field mapping. When I execute the command sf sfdmu:run --path [path to config directory] -s [source environment] -u [target environment], the resulting CSV file still shows Id,Name as headers.

Why does this happen?


Answer:

This occurs because FieldMapping is not designed to modify CSV column headers when the output target is a CSV file. The functionality of FieldMapping does not extend to renaming columns in a CSV output.

Last updated on 20th Apr 2024