Prepare source files for import


Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Before you can import data into Microsoft Dynamics 365, you must create the source data files.

The data source files that you use in an import must be formatted as comma-separated values (.csv), XML Spreadsheet 2003 (.xml), or text files. The use of source files enables the transfer of data from database systems that use different formats into Microsoft Dynamics 365.

A source file may contain data for one entity type or multiple entity types, such as accounts and contacts. For the source files that contain multiple entity data, you must provide a map that includes the <EntitiesPerFile> tag. Set the value of this tag to “Multiple” to indicate that there is more than one entity type in the source file. Add the Dedupe = “Eliminate” attribute to the <EntityMap> tag. This assures that if the file contains duplicate rows for the entity type, a single row is used to minimize lookup related errors.

An example of the data map with multiple entity types can be found in this location of the SDK:


Download the Microsoft Dynamics CRM SDK package.

The field values in the source file can be separated by commas, tabs, or other characters that are defined in the ImportFile.FieldDelimiterCode attribute.


Do not use non-printable characters, null (\0) or break (\b), as delimiters for the field values.

The first row in the source file should contain column headings. If you do not include headings, use the ImportFile.IsFirstRowHeader attribute to specify that the first row represents actual data. In this case, default column headings are created with the names Col1, Col2, and so on.

See Also

Import data
Create data maps for import
Blog Post: How to Import attachments programmatically

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright