Import records with alternate lookup references in Dynamics 365 CE

Import records with alternate lookup references in Dynamics 365 CE

     If you are in a place of importing bulk data into the Dynamics 365 CE, you have many choices like importing as excel, CSV or XML. But if you are having records for two tables which are related to each other as like accounts and contacts. You have to be careful while importing those records because this import may cause the following error “The lookup reference could not be resolved”. The error is due to the lookup values which are not present in the table we are looking for. This blog will guide to import the related records at a single stretch.

    For importing records with alternate lookup references, we have to get the data for both the tables. In our case, we have taken accounts and contacts table. Go to the Environment ➔ Settings ➔ Data Management ➔ Data Import Wizard. The wizard will open in the new tab. Click on the Import Data button in the wizard, a dialog box opens up for importing files.


    For importing, I have two CSV files, one contains data for accounts and another one has for contacts. I have zipped these two files, so that I can upload it as a single file. Click on choose file and select the zip file which we zipped before and click on next.

You will get to a Review File Upload Summary, in which you can make sure your CSV files are uploaded and set the delimiter. As I uploaded a CSV file, so the delimiter was comma(,). Then click on Next.

Map the source files with the dataverse table which you want to import. Ignore if it is correctly mapped already. It will take you to the Data map page where you can see two types of mappings, Default and SampleDataMap. Select Default Mapping and click Next.

In the mapping page, make sure all the fields are mapped correctly. For accounts table, the primary contact (lookup) field should be mapped with the full name field of the contact table.

For the contact table, the Company name (lookup) field should be mapped with the account name field in accounts table.

Click on Submit to finish the import. After submitting, click on Finish and move to the imports page to track the imports.

In the above image you could see all the imports are successfully completed and in this view you will know how many records are imported or failed while importing. 

Have a Great Day!

Tamilarasu Arunachalam

Post a Comment

Previous Post Next Post