Import multiple entites with CRM 2011

Objective: We have an excel sheet we would like to import into Microsoft CRM. Challenge: The excel sheet contains not only the data for one entity but for multiple ones. Instead of splitting this excel file into chunks we try to import it as whole and use CRM built-in functionality for multiple targets

  1. Of course the mapping stands first, so create one (not yet a technical one)
  2. Now we have identified that we need at least two entities, but CRM doesn’t let us create a data map for multiple entities through the UI (at least not yet). This means we have to create a more or less blank data map xml first. The SDK comes with some sample maps (sdk\resources\dataimportmaps) we can copy and modify. The “mapforsalesforcecontactaccount.xml” seems to be quite fine for this. Note: You don’t have to detail every field (attributemap) now, you can do this later in the ui.When you are ready it should look something like this:
  3. <Map Name="Name of this new map" Source="SourceName">
     <Description>A nice description to find it easier in a later point of time.</Description>
     <EntitiesPerFile>Multiple</EntitiesPerFile>
     <EntityMaps>
     <EntityMap TargetEntityName="new_inquiries" SourceEntityName="new_inquiries_source" Dedupe="Ignore" ProcessCode="Process">
     <AttributeMaps>
     <AttributeMap>
     <SourceAttributeName>last_name</SourceAttributeName>
     <TargetAttributeName>new_lastname</TargetAttributeName>
     <ProcessCode>Process</ProcessCode>
     </AttributeMap>
     </AttributeMaps>
     </EntityMap>
     <EntityMap TargetEntityName="lead" SourceEntityName="lead_source" Dedupe="Eliminate" ProcessCode="Process">
     <AttributeMaps>
     <AttributeMap>
     <SourceAttributeName>last_name</SourceAttributeName>
     <TargetAttributeName>lastname</TargetAttributeName>
     <ProcessCode>Process</ProcessCode>
     </AttributeMap>
     </AttributeMaps>
     </EntityMap>
     <EntityMap TargetEntityName="new_questionresponse" SourceEntityName="new_questionresponse_source" Dedupe="Ignore" ProcessCode="Process">
     <AttributeMaps>
     <AttributeMap>
     <SourceAttributeName>job</SourceAttributeName>
     <TargetAttributeName>new_textresponse</TargetAttributeName>
     <ProcessCode>Process</ProcessCode>
     </AttributeMap>
     </AttributeMaps>
     </EntityMap>
     <EntityMap TargetEntityName="new_questionresponse" SourceEntityName="new_questionresponse2_source" Dedupe="Ignore" ProcessCode="Process">
     <AttributeMaps>
     <AttributeMap>
     <SourceAttributeName>AnyOtherColumn in your source file</SourceAttributeName>
     <TargetAttributeName>new_textresponse</TargetAttributeName>
     <ProcessCode>Process</ProcessCode>
     </AttributeMap>
     </AttributeMaps>
     </EntityMap>
     </EntityMaps>
    </Map>

    Note: In this example even one entity is imported two times (with of course different data). One thing to keep in mind here you cannot specify the same sourceentityname more than once.

  4. Ok, now that we have the data map xml we’ll import it in CRM
  5. The data map should now be in our CRM. “Modifying” it is only possible while importing. So save the excel sheet that you have csv (unfortunately excel files are not supported). And start an import.
  6. Specify your file and its delimiters
  7. Select the newly created map
  8. Now in the next screen you can see the entities specified before in the xml. Clicking on one of them brings you the modify screen where you can do your mapping via the UI.
  9. Another cool thing is that for lookups you can specify the search field
  10. In the last screen (before importing) you can specify a name of a data map you would like to save the just modified one to save under
  11. And that’s it, we have a great data map we can work with

This guide is a starting point, although knowing that there are of course further cool things like “Transformation Mappings” which are not possible through the UI again. Transformation Mappings offer you for example the following (refer to the SDK for some more details):

  • Concatenation
  • Split
  • Substring
  • Replace
  • Assign Value
  • Add to Date
  • Adjust Current Date and Set Time
  • Advanced Add to Current Date
Dieser Beitrag wurde unter CRM 2011, Microsoft Dynamics CRM abgelegt und mit , verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>