Azure Data Factory to SalesforceConnectorav2 NOT allowing source id to map an external Id on parent object

Hara Sahoo 0 Reputation points
2025-05-30T12:44:13.3666667+00:00

Myobjects and field names:

  • Parent object: Service_Detail__c
    • External ID field: Service_Id__c (must be marked as External ID in Salesforce)
  • Child object: Child__c
    • Lookup field: Service_Id__c (this is a lookup to Service_Detail__c)

You want to insert into Child__c and link each record to the parent using the parent’s external ID.

Source Data Example

child_field_1 child_field_2 service_id
value1 value2 SVC-001
value1 value2 SVC-001
value3 value4 SVC-002

Where service_id is the value of the parent’s external ID (Service_Id__c in Service_Detail__c). Using the value in service_id, salesforce should be able to look up to the parent object (service_detail__c) external field service_id__c and link the child record(newly to be created) to the parent record via external Id relationship


Salesforce Field Mapping Syntax

When mapping in ADF Copy Activity, use the following mapping:

Explanation:

  • Service_Id__r = the lookup relationship on Child__c (the API name of the lookup field, with __r for relationships).
  • Service_Id__c = the external ID field on the parent (Service_Detail__c).

But while mapping, i dont see the option to map service_id to the external Id, attached image

Source Column Salesforce Field Mapping
child_field_1 child_field_1__c
child_field_2 child_field_2__c
service_id Service_Id__r.Service_Id__c

Image from my environment.I am able to map the source to the target salesforce fields for fname and lname but for service_id i am not able to map it correctly, resulting in error.User's image

Please advise what could go wrong.

In short i should be able to insert child records in salesforce, and during insertion , i should be able to link it to the parent record, using parent's external Id(value in this field is stored in a database outside of salesforce)

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

1 answer

Sort by: Most helpful
  1. J N S S Kasyap 3,625 Reputation points Microsoft External Staff Moderator
    2025-05-30T13:54:06.77+00:00

    Hi @Hara Sahoo

    You correctly identified that the parent record should be linked using the external ID, which is great. However, ADF’s UI doesn’t support mapping lookup fields via external ID directly. That’s why you didn’t see the correct field in the dropdown. 

    The fix is to use the Advanced Editor in the Mapping tab and define the mapping in JSON format manually,This way, you can specify the relationship using Service_Id__r.Service_Id__c, which tells Salesforce to resolve the parent using the external ID. 

    Manually define your mapping in JSON like this: 

    [
      { "sourceName": "First_Name", "targetName": "First_Name__c" },
      { "sourceName": "Last_Name", "targetName": "Last_Name__c" },
      { "sourceName": "Service_ID", "targetName": "Service_Id__r.Service_Id__c" }
    ]
    
    

    This approach will allow the child records to be inserted and automatically linked to the correct parent via the external ID without needing internal Salesforce IDs. 

    I hope this information helps. Please do let us know if you have any further queries.

    Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.