There is a new way of exporting your data from a Dynamics 365 Customer Engagement environment (or the underlying CDS For Apps environment). In this blog post I will show you how you can export your data from your Common Data Service environment and the potential issues you may encounter doing so.
How to export data from Common Data Service for Apps?
Exporting data from you CDS for Apps environment is pretty straightforward. First you navigate to web.powerapps.com. Make sure you have the correct environment selected (see top right). After, you go to Data and Entities. Now select the entities of which you want to export the data. Note that you can export multiple entities at the same time. Click on “Export data” to start the export.
In the background, a Data Integration project is created and responsible of exporting our data (you can take a look at PowerApps admin center for the Data Integration project definition and status). After a little while a file should be available for download. Done!
Unfortunately due to caching issues at the PowerApps Data Integrator service, things might not always behave as expected. In the next section we will discuss the issues I encountered and how we can overcome them.
Issues when exporting data from PowerApps
Now matter how many times I tried to export my entity, some (newly created) fields remained missing from my data. Thanks to a post from BrianSlalomMS, I learned that the PowerApps Data Integrator caches the entity metadata. So to fix this issue, we just have to refresh the cache, right? Now, how do we do that?
Refreshing the entity metadata cache
Following steps will show you how to refresh the entity metadata cache of the underlying PowerApps Data Integrator service. First, navigate to the PowerApps Admin center. Next we select “Data integration” and open the most recently created Data integration project.
When viewing the details of the Data Integration project, there appears a button “Refresh entities” on the top. Clicking the “Refresh entities” button will force refresh the entity metadata.
Now, trigger a new data export (from web.powerapps.com) and see your missing fields appear! Oh wait, some of my fields are still missing. What is going on?
Taking a more thorough look into the documentation, it seems that there is a list of unsupported datatypes for our Data Integration service. At the time of writing these are:
- Multiselect option set
In my case, I was specifically interested in the multiselect option set so it would never work. Well, back to the classic way of exporting our data then.
Exporting data into Excel using a model driven app (classic or unified interface)
In this section we will explain how to export your data from a model driven app previously referred to as the ‘classic’ way. First we navigate to the main grid of your entity that you would like to export using your favorite model driven app (e.g. Sales). Note that you can only export one entity at a time. By default the export functionality will only take fields of the active view into account. Most of the times this won’t suffice, so we have to add additional fields to our view. We can use our favorite tool Advanced Find to create a view ad-hoc. Click on the funnel icon to open Advanced Find.
Add the columns to your view that you want to make part of your data export.
Run your advanced find and export the data using “Export Contacts” > “Static Worksheet”.
An Excel sheet will be downloaded. In this case I was able to export the data having my Multiselect option set.
There are two main ways to exporting our data from a Dynamics 365 Customer Engagement environment. One is the ‘classic’ way by using a model driven app to export our data into a static Excel worksheet. The alternative (more modern) way of exporting our data is using the PowerApps data integration service. But this service has some limitations today. One of them being not correctly refreshing the Entity Metadata cache and the other being some unsupported data types. Hopefully Microsoft will fix these cashing issue and close the gab for the unsupported datatypes. As an alternative you can try to manual refresh the cache or use the classic way of exporting the data depending on the scenario.
Of course there are alternative (more advanced) ways into exporting our data. Think about using SSIS for example. Those services were out of scope of this blog post.
Hope this helps.