Search code examples
dynamics-crmmicrosoft-dynamicsdynamics-365data-importdynamics-crm-365

MS Dynamics CRM 365 - import data from Excel files


I'm getting into MS Dynamics CRM 365 programming, and have been dealing with data imports of lookup / reference entities.

I created a new entity with just the default Name column, stored and published it, and then went to look at in CRM. From the default "main" view, I choose the "Data Import" option and downloaded a template .xlsx file, which I then filled out. After that, I chose "Import Data" and uploaded this filled out .xlsx, and it was submitted, parsed, transformed successfully and the rows I had entered show up as expected.

So far, so good.

Now I created a second lookup entity (again with just the Name field), published it, and thought I'd be smart and just "re-use" that .xlsx "template" I had downloaded for the first lookup entity, and enter the new values for the second lookup entity, and then upload this manually "recycled" file. I did change the file name of the .xlsx, as well as the worksheet name, to match the name of the second lookup entity.

And while the upload, the parsing and transforming worked just fine - the actual rows I had inserted ended up in the first lookup entity...

So my conclusion is: somewhere, CRM must keep track of what entity that .xlsx was indended for - and it's neither the file name of the .xlsx, nor the name of the worksheet (which I had also updated) - it must be stored somewhere else.

Does anyone know where?? Can I change it somehow (manually or programmatically)?

After I went through the full cycle again (download import template .xlsx, fill that out, upload that file) - it works just fine for the second lookup entity, too.


Solution

  • There will be a hidden sheet in Excel file, but we cannot unhide it. That’s where all the configurations are stored.

    But you can see it when you do something like explained in this blog, you have to click “View code” option from context menu, by right clicking sheet name tab in Excel file.

    Then by opening the “Project explorer”, the hidden sheet will be visible in VBA, set the visibility to 1 – xlSheetVisible. Don’t save anything.

    enter image description here