Azure · Data Migration And Integration

{Dynamics 365} Setting Multi Entity lookup field while writting data from Azure Data Factory

While working on one of the integration in my current project where we wanted to write data to CRM from CSV file which was placed on Blog storage on Azure.

We had the requirement to create Task record and also set owner field on CRM which is a multi entity lookup. Owner field can be either User or Team.

I will not provide set by step guide in this article to setup integration. See article here for step by step guide to load data from csv to CRM from Azure data factory.

In this post I will explain how we can set multi entity lookup field while writting data to Dynamics CRM from Azure data factory.

Trick is achieve this requirement to add another column in CSV which will tell the target entity to set for the lookup. See below CSV file which has ownerid column which is systemuser GUID and Target column which is target entity entity name for the owner lookup i.e systemuser.

OwnerId,Notification,Description,Action_Date,Target
“bc632243-2652-ea11-a815-000d3a33e825″,”Test”,”Homebuying Unlocked”,”2020/06/25″,”systemuser

If we need to set owner lookup to Team, We just need to set the target column value to team in csv.

Now In copy-activity column mapping, map the two columns as follows:

  • Owner Id to ownerid. This mapping is the normal field mapping.
  • Target to ownerid@EntityReference. The sink column is a virtual column representing the entity reference. Input such field names in a mapping, as they won’t show up by importing schemas.

ADF Sink

Hope this helps!

One thought on “{Dynamics 365} Setting Multi Entity lookup field while writting data from Azure Data Factory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s