Retrieving email CC using Dataverse Web API

Using the Dataverse Web API you can pretty much run any CRUD (create, retrieve, update, delete) operation in the Dynamics 365 applications. However, you still find today some special cases like the one that I’m going to talk about in this article.

This special case is actually brought by the column type “PartyList”, which has always been a particular one in the platform.

Let’s say we have a simple email like this one:

Using the following GET request, we can retrieve the emails modified in the last hour, including the one above:

Notice how we have been able to retrieve the from and to columns using the corresponding complementary string columns sender and torecipients. What about the cc or the bcc columns? Well, unfortunately they don’t have a complementary string column that we can use. So, if you try to add the “cc” column or the lookup equivalent one like “_cc_value” in the select query, you would get an error like this:

    "error": {
        "code": "0x0",
        "message": "Could not find a property named '_cc_value' on type ''."

Here is the first solution, you could use the relationship: email_activity_parties

Expand your query using this relationship and it will return all the activity parties involved in the email.

Notice you will need then to use the Activity Party attributes addressused and participationtypemask to retrieve the corresponding email address and the role that is playing the participant.

An alternative to this solution is to use FetchXML. The Dataverse API also accepts a FetchXML query as a parameter which can be convenience in certain scenarios:

2 thoughts on “Retrieving email CC using Dataverse Web API

  1. Hi Ramon, I have a question. In my project, we need access to the marketing data (e-mails). I have been searching for information and I can see that with Power Apps or Power Automate and Dataverse I can get the data, but is only data that I can access with Power BI. That means analytics … Do you know if I can access the table “emails#” from Marketing? I want to download data to Azure Data Lake and then export the data to other destinations.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s