Our clients wants to send surveys to their customers to improve their service and quality. The client is using Dynamics 365 Marketing Event management. So our choice was to use Customer voice for sending the surveys and collecting the responses. Analyses will be done in PowerBI. This blog provides some tips and tricks for the creation and sending of the survey invites. 

In PowerAutomate we can find two actions for Customer Voice.

  1. Create an invitation – creates an invitation and returns an invitation url which you can sent to the client in the way you want
  2. Send a survey – creates an invitation and sends the invitation to the clients directly by using the customer voice sending mechanism

 

In our case we wanted to sent the invitation ourselves with the Dynamics marketing module so the marketing department was in control of the email layout, so we choose to use the Create an invitation action.

 

First challenge, you have to select a Project and Survey. These are related to the environment. We wanted to make sure that we can deploy our flow through DEV, TEST, PROD without any modifications, so we needed to make sure that Project and Survey are parameterized. This can be done by using environment variables.

 

You can find the values for Project and Survey on the Customer Voice survey record in your dataverse environment.

Fill in the other fields

Email:

Emailaddress to which the invitation will be sent. This is needed to create the invitation even when the invitation is not really sent, but only created. We found that emailaddresses with special characters like a ‘+’ sign cannot be handled by the invitation action. So we build in a check in our flow to exclude these emailaddresses.

 

Regarding:

Can be left blank. The record to which the invitation will be related in Dataverse. Can be used for reporting purposes and also to show that the invitation is created on the timeline of the record.

 

Recipient details:

Can be left blank. When left blank the system will try to match a contact in the system based on the provided email address in the field Email. When provided the invitation will be linked to the provided contact in this field.

 

Both Regarding and Recipient fields must be provided in a special way, other than the standard Powerautomate/dataverse way like “contacts(GUID)”. In this action we must use “contact,GUID”.

 

So the schemaname of the entity (not plural!), followed by a comma and the GUID. Took me a long time to figure this out ☹, as its not well documented by Microsoft.

Source: https://learn.microsoft.com/en-us/dynamics365/customer-voice/create-survey-invite

 

 

All the other fields are variables from the Customer voice survey. You can fill them as needed.

 

 

Linking the Customer voice invitation to another record in the system

 

Our client wanted to see if an invitation was sent for a specific planned resource.

So we created a new column on the dataverse table for the planned students for a session. This is a lookup to the Survey invitation record. Now we can show the status of the invitation record.

 

The only thing we needed to do now is when the survey invitation record is created for the student we must connect this to the planned student record.

 

The action provides us the Invitation Id, which is the ID of the Survey Invitation in the system.

 

So the next step was to update the planned Student with this ID

Pretty easy….but sometimes my flow was failing.

{ “error”: { “code”: “0x80040217”, “message”: “Entity ‘ActivityPointer’ With Id = b2d1f607-66ba-4d58-afa5-119ff92e8a1a Does Not Exist”, “@Microsoft.PowerApps.CDS.HelpLink”: “http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040217&client=platform”, “@Microsoft.PowerApps.CDS.InnerError.Message”: “Entity ‘ActivityPointer’ With Id = b2d1f607-66ba-4d58-afa5-119ff92e8a1a Does Not Exist” } }

 

Cause: The Customer voice invitation record is not being created synchronously via the Create invitation action. It can take some time from a couple of seconds to a couple of minutes until the Customer voice invitation record appears within Dynamics.

 

A possible workaround for this issue is to build in a Delay step in the flow.

Or updating the Planned Student record via another flow which triggers on creation of the Survey invitation record.

 

Sending variables to Customer Voice Survey

 

In the Create an invitation action there are two ways of providing variables. One way by adding them to the fields provided by the action. These field become available when a specific survey is selected in Powerautomate in the Survey field.

But what if the Survey is an output from another step in your flow?

Then the action provides you a special field [The field to send to WebMerge] where the variables can be set by adding the variable name and value in json format.

 

Sending the Survey from Dynamics Marketing

 

Create a new trigger for the Marketing department which can be selected in a journey as a step.

 

Only attributes are the Contact (audience) and the Survey which needs to be sent need to be provided.

 

The logic for the trigger will be implemented by PowerAutomate. This logic will create the survey invitation and will update a record (in this case the Event registration) with the survey link url.

 

Now in the journey the Marketing department can select to create a survey invitation, choosing the wanted survey, and use the survey invitation url in the Marketing e-mails in the journey.

 

 

Laat het ons weten!

Neem gerust contact op als je wat meer van onze dienstverlening wilt weten.