Recently, I was asked by a ClickDimensions customer if there was a way to view all email activities from contacts that belong to an account. Initially, I thought, “No problem! That’s a simple advanced find!” However, when I started diving into things, I very quickly ran into some problems. Not to worry, I came up with a solution. Let’s take a look!
When I first built out my view of sent emails where the recipient has a related account record, I thought that I could simply add this to the account record as a sub-grid. However, I quickly learned that this would not give the desired effect. Since you can send emails directly to an account’s listed email address, there was an existing relationship there. If the email was sent to a contact, that Account value on the sent email is blank:
After much trial and error, I decided that the best thing would be to populate the Account value with the recipient’s related account each time the sent email record is created. To achieve this, I turn to Power Automate, of course! In my example, I chose to run the flow each time a sent email record is created. If this is too resource intensive for you, I recommend using a scheduled flow and listing all sent emails that were created on that day.
Let’s look at the flow. As always, we’re using the Common Data Service (current environment – or whatever it’s called at the time of reading this blog since it has changed three times in the last month as of this writing).
I have also set a filter on this action that will only trigger on records where the Contact value is not empty. If you’re not sure how to achieve this, check out this blog by Sara Lagerquist. Once we have the correct record, we need to retrieve the contact record via the Get Record action. This will allow us to reference values on the contact related to the sent email record.
Now we need to check if the contact has an associated account record. I decided to use a Control action:
Here, I am checking if the Company Name field on the contact record has a value. If the condition is true, I’m going to update the sent email record with this value:
So now when a sent email record is created, it will now be populated with the contact’s account:
I have also implemented similar flows for other entities like email events, website visits and posted forms.
Now let’s look at how adding a very simple rollup field to the account record can give us a complete picture of the account.
Adding a simple rollup field to the account record to show a total score value for all related contacts can be a great way of determining how “hot” an account might be. The formula for the rollup field is simple and can be set up as follows:
And now we have a complete picture of the account’s activities and can proactively market to our accounts!