Introducing our new Activity Tracking Dashboard. View announcement

MME Technology Blog

How to use Email Data in Salesforce Data Cloud

How to use Email Data in Salesforce Data Cloud

We are living in an exhilarating time for AI and data. Data projects that used to take tremendous resources and manpower can now be done in a fraction of the time. Tools like by Salesforce Data Cloud can enable one IT admin to do what used to require a team of three engineers, a project manager and lots of meetings.

These new AI and data tools are especially valuable for email data. While email is where lots of valuable customer activity happens, businesses have historically run into difficulties extracting insights from this data because it is unstructured.

You can leverage Data Cloud to connect email data to other data sources, analyze it with AI, and much more. This combination opens all kinds of new possibilities. In this guide, you will see one of the ways you can work with email data with Data Cloud from Salesforce.
 

How Salesforce Data Cloud Works

Salesforce Data Cloud makes it easy to combine large sets of data from many data sources. This data can come from sources like Salesforce where the data is already mapped nicely to Data Cloud’s unified data model or from external sources where admins can set up custom mapping for the data to fit into it’s unified data model. Once you have brought your data together in Data Cloud it is easy to use it for:

  • Analyzing large sets of data from multiple data sources.
  • Market segmentation
  • Merging large sets of data
  • Using your company data with AI agents

 

While these are a few examples, Data Cloud can do much more depending on how much time you want to invest in developing your company’s Data Cloud environment.
 

Match My Email makes it possible to work with email data in Data Cloud

If you aren’t familiar, Match My Email is a dependable and automated email and calendar integration tool for Salesforce. Match My Email stores all of your company’s email and calendar data directly in your Salesforce org. This gives your team the ability to use your company’s email and calendar activity data in standard reports, flows, and AI tools. It also makes it very easy to map your email and calendar data into Salesforce Data Cloud.

Salesforce Data Cloud already includes preset data mapping for Sales Cloud. This pre-set mapping includes the Salesforce objects Match My Email stores email and calendar data in. This means it’s easy to analyze email data in Data Cloud. Once in Data Cloud, it is also possible to combine email data with other data sources.

In the tutorial below, we will show you how you can set up email data in Data Cloud from the standard Email Message object for Contacts in Sales Cloud. You can use the same logic for the setup of the Contacts data stream and relationships to set up similar Salesforce objects like Leads, Accounts, Opportunities or custom objects. This tutorial is geared towards customer uploading emails as Enhanced Emails for Match My Email. We plan to put together a guide for this same process for customers uploading with the custom object in the future.
 

Tutorial: How to bring Email Data into Data Cloud

Before starting to configure email data:

  1. Ensure you have a Data Cloud or marketing admin access in your Data Cloud org.
  2. Ensure your business stores Email data in Salesforce in the Email Message object. If not, you can use tools like our tool, Match My Email, to set up automatic and reliable email and calendar sync.
  3. Ensure you are connecting Data Cloud to data in Sales Cloud in the same Salesforce org. If not, follow these steps: Salesforce Help Article

 

Now we are ready to start bringing email data into Data Cloud:

We can begin by setting up a data stream for the Email Message object. A data stream is the way data gets into Data Cloud. Once this data stream is set up email data stored in the Email Message object in Sales Cloud will be able to flow to Data Cloud.

  1. In Data cloud, go to the Data Streams tab.
  2. Click “New”.
  3. For your connected source, select “Salesforce CRM”.
  4. After selecting your Salesforce org to ingest data from, click “View Objects”.
  5. Select the “Email Message” object.
  6. Click “Next”
  7. Under EmailMessage Details, for Object Category, select “Other”.
  8. Click “Next”
  9. Select the default Data Space or the Data Space of your choosing.
  10. Click “Deploy”.

 

Map Email Data to the Email Message DMO

With a data stream set up, we can now start mapping the Email Data from Sales Cloud to Data Cloud’s standard data model object. This may sound complicated, but it is actually pretty straightforward.

Because Data Cloud is its own data system, it has its own definition of an email message that has differences with the way Sales Cloud defines an email in the Email Message object. Mapping is done to make sure that the email data fits nicely into Data Cloud’s system. Because both tools are within Salesforce, Salesforce automatically maps several fields without us having to do anything.

Before beginning, it is important to know that Data Cloud has complicated things happening in the background. For this reason you may see some odd errors throughout the process. Do not be derailed by them. If you come across an unexpected error first try to wait a moment or try the action again. In most cases, they will go away pretty quickly.

  1. Click on the data stream you just created.
  2. Click “New Formula Field”.
  3. Set the field label to “Email Direction” and let API autofill.
  4. Set formula return type to “Text.
  5. Set transformation formula to be: IF(sourceField[‘Incoming’] == ‘true’,”Received”,”Sent”).

 

Edit Formula Field
 

  1. Click “Save”.
  2. Under Data Mapping, click “Start” (or “Review” if you have already saved some mapping).
  3. On the right of the screen under Data Model entities, click “Select Objects”.
  4. Under All Objects, search for “Email Message” and select it with the plus button.
  5. Click “Done”
  6. Click “Save” in the top right of the page.

 

At this point, you should see that several email message object fields on the left automatically map to the Email Message DMO(data model object) on the right.
 

Email Message DMO
 

  1. Click the mapping icon next to the “Close” button at the top.
  2. Select “Table View”.

 

Select Table View
 

  1. Click “New Custom Field”.
  2. Name the field “Email Direction” and let the Field API Name populate.
  3. Select a data type of “Text”.
  4. Click “Save”.
  5. If the “Is Incoming” field is mapped from the left to the right, delete the mapping by clicking on the mapping arrow connecting the two fields.
  6. Next to the “Email Direction” field, select “Email Direction” in the Target Field column.
  7. Click “Save”.

 

Map Email Message Relation Data

Next, we want to map the Email Message Relation object from Salesforce. This object will be very helpful for connecting all the data together.

  1. Go to the Data Streams tab.
  2. Click “New”.
  3. For your connected source, select “Salesforce CRM”.
  4. After selecting your Salesforce org to ingest data from, click “View Objects”.
  5. Select the “Email Message Relation” object.
  6. Click “Next”
  7. Under EmailMessageRelation Details, for Object Category, select “Other”.
  8. Click “Next”
  9. Select the default Data Space or the Data Space of your choosing.
  10. Click “Deploy”.
  11. Click on the data stream you just created.
  12. Now we will add a field called “Contact ID”. Click “New Formula Field”.
  13. Set field name to “Contact ID”.
  14. Set formula return type to “Text.
  15. Set transformation formula to be: IF(sourceField[‘RelationObjectType’] == “Contact”, sourceField[‘RelationId’],””)

 

Edit the Formula Field
 

  1. Click “Save”.
  2. Under Data Mapping, click “Start” (or “Review” if you have already saved some mapping).

———————–

  1. Click the mapping icon next to the “Close” button at the top.
  2. Select “Table View”
  3. Click on the input field labeled “Select data model object”, then click on “View Object Panel”
  4. Under All Objects, search for “Engagement Action” and select it with the plus button.
  5. Click “Done”
  6. In the table, on the row next to “Email Message Relation ID”, make the target field “Engagement Action Id”
  7. On the row next to “Email Message ID”, make the target field “Email Engagement”
  8. On the row next to “Contact ID”, make the target field “Contact Point”
  9. Click “Save” in the top right of the page.

 

Map Contacts if you haven’t yet.

  1. Go to the Data Streams tab.
  2. Click “New”.
  3. For your connected source, select “Salesforce CRM”.
  4. After selecting your Salesforce org to ingest data from, click “View Objects”.
  5. Select the “Contact” object.
  6. Click “Next”
  7. Under Contact Details, for Object Category, select “Profile”.
  8. Click “Next”
  9. Select the default Data Space or the Data Space of your choosing.
  10. Click “Deploy”.
  11. Click on the data stream you just created.
  12. Under Data Mapping, click “Start” (or “Review” if you have already saved some mapping).

———————–

  1. Click the mapping icon next to the “Close” button at the top.
  2. Select “Table View”
  3. Click on the input field labeled “Select data model object”, then click on “View Object Panel”
  4. Under All Objects, search for “Contact Point Email” and select the plus button next to it.
  5. Click “Done”
  6. In the table, on the row next to “Contact ID”, make the target field “Contact Point Email Id”
  7. On the row next to “Email”, make the target field “Email Address”
  8. On the row next to “Full Name”, make the target field “Party”
  9. Click “Save” in the top right of the page.

 

With all of these data streams set up, this means a lot of valuable data from Sales Cloud can easily flow into Data Cloud. This data is not connected yet but the foundation for the many great things Data Cloud can do.
 

How to Link the Data Together

If all of your data streams are set up, well done. Next, we just need to link the data streams together. When we connect these data streams, the sum becomes much more valuable thank the value of its parts.

For the sake of simplicity, we will set up 3 data stream relationships but use this as a guide to set up more relationships your business may need.

  1. Go to the Data Model tab.
  2. Click into the row labeled “Engagement Action”.
  3. Click over to the “Relationships” tab.
  4. Set up the following relationships so the fields match on your page the image below:

 

Engagement Action
 

Note: For Cardinality “1:1” is the same as OneToOne and “N:1” is the same as ManyToOne.
 

How to Set Up a Simple Standard Report with this Data

With data steams linked with relationships, we can look at the combined data in all kinds of interesting ways with standard reports.

  1. Go to Setup
  2. On the finder on the left, search for and go to “Report Types”.
  3. Create a custom report type
  4. Primary Object, select “Contact Point Email (Data Cloud)”
  5. For display label, enter “Contacts and Email Activity”.
  6. For the description, write “Use this report to create reports using contacts and email data in Data Cloud.” or something similar.
  7. For Store In Category, select “Data Cloud” or a category more suitable for your org.
  8. Select appropriate status.
  9. Click “Next”.
  10. Click “(Click to relate another object)”
  11. Select “Engagement Action (Data Cloud)”
  12. Select ‘”A” records may or may not have related “B” records.’
  13. Once created click into the report type you just created.
  14. Click “Edit Layout”.
  15. Click “+New Section”.
  16. Name the section “Email Message”.
  17. Click “+Lookup Fields”
  18. Set Field Related To to be “Engagement Action (Data Cloud)”
  19. Expand the “Email Message” section.
  20. Select “Is Incoming”, “From Name”, “Created Date” and “Subject”
  21. Click “Apply” at the bottom of the section.
  22. Click “Save”.

 

Next, we will set up the report.

  1. Go to the Reports page
  2. Click “New”
  3. For selecting a report type, if available select “Contact Point Email with Engagement Action. If this was possible, skip to step 16. If not, continue with the next step.
  4. For Group Rows, select “Party” and then “Email Direction”. (If Email Direction does not appear, click “all fields”)
  5. For Columns, add “From Name” and “Subject”.
  6. Click “Save & Run”

 

How to Set Up a Simple Standard Report with this Data
 

And you are done, you have completed this tutorial!

Thank you following along for this process. This tutorial was thorough but we believe if you have worked through it all, you have an idea of all the steps needed to utilize data cloud with email data in the way more valuable to your organization!

Have feedback or thoughts on this tutorial? Send them to ben@matchmyemail.com. He will be checking to see if there are ways to improve the tutorial to be as helpful as possible.

Read More From The Email Technology Blog