Freigeben über


Multi-Entity data file import mapping

Recently, we published a post on our global CRM Blog that talks about a feature in Microsoft Dynamics CRM 2011 through which you can Import data from a single source file into multiple entities.

Importing two or more entities from a Single File

https://blogs.msdn.com/b/crm/archive/2010/11/04/importing-two-or-more-entities-from-a-single-file.aspx

The example in the Blog post and out of the box is only if you have a single CSV file that has data that you want to split across the Contact and Account entities.

clip_image002

But, and if we want to do it for other entities (including custom entities)?

Let’s see how we can do it:

I created this Excel file with data from two entities (Contact and a custom entity called Soup):

image

Then, using Visual Studio as XML editor, created this Multi-Mapping test file, where I refer both entities and “Multiple” as EntitiesPerFile:

<Map Name="Multi-Mapping Test" Source="Import">

       <Description>Multi-Mapping file created by me</Description>

       <EntitiesPerFile>Multiple</EntitiesPerFile>

       <EntityMaps>

             <EntityMap TargetEntityName="contact" SourceEntityName="Contact" Dedupe="Ignore" ProcessCode="Process">

             </EntityMap>

             <EntityMap TargetEntityName="new_soup" SourceEntityName="province" Dedupe="Eliminate" ProcessCode="Process">

             </EntityMap>

       </EntityMaps>

</Map>

Having the data and the template, let’s test it:

First, we need to import the template:

clip_image004

clip_image006

Note:

If any or both entities are custom entities, they must be present in the system by this time.

clip_image008

Once imported the Multi-Mapping file, we can go to Imports and select our data file (that contains data from multiple entities):

clip_image010

And once it is uploaded, we will choose our Custom Data Mapping:

clip_image012

Using our custom mapping file, we are now able to map the data for both entities at once:

clip_image014

clip_image016

clip_image018

Best Regards,

Dynamics CRM Team

Comments

  • Anonymous
    October 16, 2011
    Is there any way to do a check if exists else create? I.e. if the soup already existed then use that otherwise create?

  • Anonymous
    October 13, 2014
    @Paul That's what the field Dedupe="Eliminate" does

  • Anonymous
    November 24, 2014
    Awesome post :) Constantly getting a SQL Timeout error when importing, and that's even when testing with the standard Account/Contact data map.  It is happening on three different environments, geographically different too, one is in Azure. I even added the OLDBTimeout and ExtendedTimeout entries in the registry, still no go :( In all honesty the standard one should work but it doesn't, not sure what i am doing wrong.   Any thoughts would be great thanks.