MappingItem Object.


🡨 Go Back to Export.json File Overview

Table of Contents



MappingItem Object Overview

The MappingItem object, a child of the ScriptObject in the SFDMU's export.json file, is critical for setting up mappings for both objects and fields between source and target Salesforce environments. It enables precise customization of data mappings, allowing specific fields from the source object to be mapped to corresponding fields in the target object.

This functionality is essential for effective data transformation and alignment during the migration process, ensuring that data is accurately transferred according to the defined mappings.

For further details on field mappings, refer to the Fields Mapping feature documentation.

Configuring Field Mappings

To utilize field mappings, you must enable the feature by setting useFieldMapping to true within the ScriptObject. Then, declare an array of MappingItem objects using the fieldMapping property:

{
  "objects": [
    {
      "query": "SELECT Id, Name, ParentId, TEST__c FROM Account",
      "operation": "Upsert",
      "externalId": "ExternalID__c",
      "useFieldMapping": true,
      "fieldMapping": [
        {
          "targetObject": "TestObject__c"
        },
        {
          "sourceField": "ParentId",
          "targetField": "ParentTestObject__c"
        },
        {
          "sourceField": "ExternalID__c",
          "targetField": "TestExternalID__c"
        }
      ]
    }
  ]
}

MappingItem Object Properties

sourceField (String)

Optional or Mandatory depending on configuration. Specifies the API name of the source field to be mapped. This property defines where the data originates within the source object.

targetField (String)

Optional or Mandatory depending on configuration. Specifies the API name of the target field that will receive the data from the sourceField. This property determines where the data will be placed within the target object.

targetObject (String)

Optional or Mandatory depending on configuration. Specifies the API name of the target sObject that is mapped from the source sObject. This is particularly useful when the field mappings involve a change of sObject context, such as when mapping fields from a source object to different target objects.

Last updated on 23rd Apr 2024