Sending Surveys through Dynamics 365 Marketing and Setting ‘Regarding to’ Field

Dynamics 365 / CRM

Powered by LUCK™

Business Case

You have a survey set up in Customer Voice which needs to be sent to a segment you’ve got in Dynamics 365 Marketing. It could also be in a journey you already set up.

If you use the OOB ‘Send an email’ action with a button pointing to your survey, although that works, you cannot set the “Regarding to” field so the survey invite gets related to your contact, account, order, or whatever other record you need it related to.

This is a problem because your users won’t be able to easily see that a survey was sent to the customer, let alone her or his response in the context of the Contact record.

The good news is that you can accomplish this by combining Dynamics 365 with Power Automate! And I’ll walk you through the steps.

What You Need and Why

Let’s take a look at the high-level architecture:

…and briefly describe the technologies that take place and what for:

  • Dynamics 365 Customer Voice (step #1) > here’s where you design your survey
  • Dynamics 365 Marketing (steps #2 and #4) > will be used to set up your segment (or trigger) + design the e-mail that goes to your customer and the overall real-time journey that you want your customer to follow.
  • Power Automate (step #3) > we’ll set up a flow that will be triggered by D365 Marketing to create the survey invites and properly set the ‘regarding to’ to the right contact record

Now that you have the architecture’s big picture, let’s dive in on how to do the actual configurations.

Note: This article assumes you have a valid commercial or trial license for each of the above products + admin privileges to perform the setup activities. It also assumes you are at least familiar with the basis of the above-mentioned technologies.

1. Set up your Survey in Dynamics 365 Customer Voice

Open Customer Voice and create a new Project and a blank Survey.

Make sure to pick your environment and click on Create.

For sample purposes, I just renamed it to ‘My Survey.’ Add a couple of questions.

You should end up with something like this:

Of course, you might want to adjust formatting and/or questions further to match your business case better.

2. Set up your Segment (or Trigger) + your Journey in Dynamics 365 Marketing

Open your Dynamics 365 Marketing App. 

For sample and testing purposes, I created a segment of only one contact (me) and a new real/time journey pointing to that segment. However, you might want to use a trigger you already have and an existing journey.

I named it ‘My Send Survey Journey’.

3. Create new fields

Navigate to Power Apps. We will add a couple of new fields to the Contact entity. 

As a best practice, you can do so from your existing solution or create a new solution just to encapsulate those changes.

Note: Make sure you’re in the right environment.

Add the Contact table to your solution (no need to include any object) and create these new fields:

  • Send My Survey (Choice Yes/No)
  • My Survey Invite URL (Text, 100)

4. Create the first custom trigger in D365 Marketing

This trigger will be actioned from your journey, making the cloud flow that we’ll be creating in the next step to run.

So, within Dynamics 365 Marketing – Triggers, create a new trigger. 

  • Name = ‘Create My Survey Invitation.’
  • Action = ‘When a customer interacts with a website/app’

Just click on ‘Next’ on subsequent steps and ensure to click on ‘Ready to use’ at the end.

No further actions are required other than just waiting for a few seconds until it’s activated.

We’re going to integrate this trigger in the next step.

5. Create the ‘Create My Survey Invitation’ Power Automate cloud flow

This cloud flow will be triggered within your journey using the trigger we created in the previous step, which will serve as a link between both.

The flow, once triggered, will create the Customer Voice Survey Invitation regarding to the Contact record.

From your solution (recommended) or from https://make.powerautomate.com/ , create a new automated cloud flow.

Set trigger to: When an action is performed

Name: Create My Survey Invitation

Now, configure the ‘When an action is performed’ trigger so it looks this way:

Catalog = Cxp

Category = Custom

Table name = (none)

Action name = Create My Survey Invitation << that’s the trigger we created in the previous step.

We need to retrieve the Contact record now to retrieve his info. So, add a ‘Get a row by ID’ Microsoft Dataverse action and for Row ID use the ActionInputs msdynmkt_profileid dynamic content from the flow trigger.

@{triggerOutputs()?[‘body/InputParameters/msdynmkt_profileid’]}

The next step in this flow will be creating the Customer Voice Survey Invitation and setting ‘Regarding to’ the Contact. 

Add the ‘Create an invitation’  action of the Dynamics 365 Customer Voice connector:

Sign in to Customer Voice and fill in the action data this way:

Project = pick your CV project

Survey = pick your CV Survey (‘My Survey’ in our example)

Email = @{outputs(‘Get_a_row_by_ID’)?[‘body/emailaddress1’]} << the Contact’s email

Subject = My Survey – @{outputs(‘Get_a_row_by_ID’)?[‘body/fullname’]} 

First Name = @{outputs(‘Get_a_row_by_ID’)?[‘body/firstname’]}

Last Name = @{outputs(‘Get_a_row_by_ID’)?[‘body/lastname’]}

Regarding = contact,@{outputs(‘Get_a_row_by_ID’)?[‘body/contactid’]} 

Recipient details = contact,@{outputs(‘Get_a_row_by_ID’)?[‘body/contactid’]}

Now, in the last step, we’ll update the Contact record with the Survey Invitation URL + toggling on the ‘Send My Survey’ field we created in step #3, so that will signal the journey back to continue by sending the e-mail to the contact.

So, add a new ‘Update a row’ (Microsoft Dataverse) action.

Table = Contacts

Row ID = @{outputs(‘Get_a_row_by_ID’)?[‘body/contactid’]}

My Survey Invite URL = @{outputs(‘Create_an_invitation’)?[‘body/Invitationlink’]} << the invitation link from the Customer Voice action above

Send My Survey = Yes

6. Create the second custom trigger in Dynamics 365 Marketing

Within Dynamics 365 Marketing – Triggers, create a new trigger. 

  • Name = ‘Send My Survey’
  • Action = ‘When a record related to a customer is created or updated

Set these values:

  • Table = Contact
  • Audience = Contact (via self)
  • Activated when An existing record was updated
  • Attribute = Send My Value << this is the field you created in step #3

And press the ‘Ready to use’ button. 

7. Send the Survey through Dynamics 365 Marketing

Open your real-time journey again. We’re going to use the trigger you set up in the previous step and do the actual send of the Customer Voice Survey invite you created in your flow in step #5 regarding to your contact.

Add an action of type ‘Activate a custom trigger.’

Select the ‘Create My Survey Invitation’ custom trigger you created in step #4. This will trigger the Power Automate flow to create the survey invitation.

Now, add an action of type ‘Respond to an action’. Set the branch condition type to ‘A trigger is activated.’ 

  • Choose the ‘Send My Survey’ trigger. 
  • Add condition to Send My Survey = Yes
  • And specify a time limit – usually it will only take a few secs or mins for your Power Automate to run and respond by toggling on the ‘Send My Survey’ field in the Contact record. So, setting it to 1 day as I did for sample purposes here will be far more than enough.

And last but not least, under the ‘Yes’ branch we’ll add the ‘Send an email’ action to send the survey to the customer. Pick an existing email or create a new one, whatever works better for you.

Add or edit a button to point to the Invite URL generated within your Power Automate. So, set the button like this:

  • For = URL
  • URL = User personalization to add a new dynamic text pointing to the ‘My Survey Invite URL’ contact field << this is the field you created in step #3

Make sure to fill in any other data required in your E-mail and hit ‘Ready to send.’

In the end, your journey should look something like this:

8. Publish and Test your journey!

We’re all set! So, go ahead and Publish your journey! You might need to set up a start date-time that works for you and how frequency will be handled.

Once started, you can refresh in a few mins to see how your segment is being processed.

Some stats may take a few more mins to get refreshed, but I’d suggest querying the Customer Invoice Survey Invite records through Advanced find. You should see that your invitations now look like this:

When you open the related contact record, you’ll see the customer voice activity in the timeline, from where you can easily open it and see your customer’s response as well.

Looking for more Dynamics 365 tutorials? Explore the rest of The Insight Blog.

Resources
Interested in how we can improve your customer and employee engagement?
Contact us for a free assessment ►

Powered by LUCK™

Search Posts

Categories

Recent Posts