Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]

This is one of the most common scenarios where you want to import an entity’s data in Dynamics 365 that has reference to some other entity. And the Lookup’s data is not yet created resulting in the Lookup reference missing. Just like below –

undefined

And resulting into the below –
undefined

And similarly while importing Contacts, the Account might not be already imported. And you get the error ‘The lookup reference could not be resolved

Most common scenario in Dynamics 365 implementations is importing Accounts and Contacts. The Primary Contact tried to lookup an already existing Contact and hence, fails.

Approach

Now, in order to handle such scenario, best and the most simple way is to import this together!

  1. Select both files and add them to a zip file –
    undefined
  2. Name it something appropriate
    undefined
  3. And import this in the Import Wizard in Dynamics 365 CRM.
    undefined
  4. You’ll see the files being included in the zip you selected.
    undefined
  5. After you review your mappings, you can confirm and Submit for Import.
    undefined
  6. There will be 2 jobs submitted and hence, 2 Imports will be created.
    undefined


Result

Now, if you check, both the Lookup references will be maintained.
Account will have the created Contact filled in Primary Contact and Contact record will have Account mapped in the Company Name field (or as per your mappings.)

undefined

In case you might want to look at some more Dynamics 365 CRM posts, you can check below –

  1. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  2. Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.
  3. Refresh button missing on Roll-Up fields in D365 UCI? Quick Tip.
  4. Store ‘Today’s Date’ in a field to use in workflow conditions in D365 CE
  5. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  6. Kanban view in Dynamics 365 Sales | 2020 Wave 1 Early Access Feature
  7. Time/Expense Entry Rejection comments in D365 PSA v3
  8. Custom View Filter JS code not working in Dynamics 365 CE. Why? [Quick Tip]
  9. Show Loading Screen in Dynamics 365 using Client API reference
  10. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Hope this helps!

Excel Importing Notes (Annotation) entity in Dynamics 365 CRM

Preparing an Excel Template for Notes entity is a little tricky. Doesn’t work when you just Export directly as a Template from the Templates Wizard and try to include all columns and import as is. Why? Because there’s no Regarding field exported when you export/import that template.

undefined

Here’s what you can do as a workaround.

Scenario

Now, let’s assume you want to Export a standard Excel Template for import so that you can re-import into Dynamics for Notes entity for a regarding entity.

Exporting Excel Template

Your Document Templates are where all your Excel Templates can be exported from –

Now, follow the below –

  1. Select Notes entity and Edit Columns you need to Export the Excel with your required columns

  2. Select the columns you need. Observe that you don’t get Regarding column to export


  3. Then Download the file.

Modifying the Excel

Now, since you don’t have the Regarding field in the Excel you exported from Templates, here’s what you need to do –

  1. Add a column yourself, give it a proper name based on what the Notes’ Parent entity should be. In this example, I’m importing Notes for Account. So, I’m adding a column called ‘Account Name’


  2. A new column will be created as below

  3. Now, populate your data based on how the Notes should be imported and tagged to which records.

  4. Now, by default, this template is exported in Microsoft Excel Worksheet (xlsx) format. You’ll need to Save As in CSV format

Re-Importing

Up until above, your Excel is ready to be imported. Let’s begin –

  1. Import the file as a usual Excel Import in Dynamics 365 CRM. Since this is not a direct Template importing as is, but a CSV, you’ll get to map this file manually.
    undefined

  2. Then, you’ll need to manually select the Note entity from the drop-down and then proceed
    undefined

  3. Now, whatever is mapped automatically will be mapped. For the newly created Account Name field, you’ll need to expand the Not Mapped dropdown and select Regarding (Lookup)
    undefined
  4. Now, you’ll need to select the entity you want the Notes to appear under. In my case, this is Accounts, so I have it right there
    undefined
  5. Since this Regarding fields supports several entities, scroll all the way down to Confirm your selection
    undefined

  6. Now, your Regarding field is set and you are ready to confirm and Import
    undefined
  7. Now, my Import here is completed. (You’ll need to take care the Import is successful)
    undefined

Imported Notes

If you look at the records now, the Notes will be attached to the respective Regarding records
undefined
undefined

Here are some more posts on D365 CE you might want to look at –

  1. Pass selected rows’ GUIDs to ribbon button in D365 | Ribbon Workbench
  2. Refresh button missing on Roll-Up fields in D365 UCI? Quick Tip.
  3. Check Managed Solution failures in Solution History in D365 CE
  4. Button Flow in Power Automate to replicate a Quick Create Form in D365 CE
  5. Create a support Queue in D365 CE
  6. What is “Does not support untyped value in non-open type” ODataException in creating records in D365 CE?
  7. Set Lookups in Xrm.WebApi D365 v9 correctly. Solving ‘Undeclared Property’ error
  8. Set Work Hours Template to a Bookable Resource in D365 PSA v3
  9. Modified By (Delegate) & Created By (Delegate) in D365
  10. Qualify Lead in D365 CE: Select which entity records should be created

Hope this helps!!