Use Case - Answering a Dynamics Customer Voice Survey within the IVR

Create a survey, allow customers to reply to it via the IVR, and collect, answer, and analyze replies in Customer Voice.

"Microsoft Customer Voice" is an easy to use customer survey tool providing text-based surveys via forms. Surveys can be sent out to customers using a short link. Customers can answer anonymously or on invitation. Microsoft Customer Voice also integrates with Microsoft Dynamics and enhances the information displayed on the customer page with survey insights.

Nimbus can make use of customer voice surveys as well, by covering the following scenario:

  • We want to allow customers to reply to a survey via the IVR.
  • The replies should directly go to Customer Voice and answer the referenced survey.
  • Supervisors can then analyse the responses in Customer Voice, or in Dynamics if they've integrated with it.

PRECONDITIONS

  • Enterprise Routing You require an Enterprise Routing license on your service to make use of "Save to Parameter" Workflow Activities and the Microsoft Power Automate Connector.
  • You require Nimbus service owner rights to to create the workflow.
  • You require Nimbus service owner rights to to create the Power Automate flows or have them set up by a global administrator. 

Furthermore, outside of Nimbus:


🔍 Note: Customer Voice Data flow | Microsoft Learn

 

 Show Icon Legend

💡 = A hint to signal learnings, improvements or useful information in context. 🔍 = Info points out essential notes or related page in context.
☝ = Notifies you about fallacies and tricky parts that help avoid problems. 🤔 = Asks and answers common questions and troubleshooting points.
❌ = Warns you of actions with irreversible / data-destructive consequence. ✅ = Intructs you to perform a certain (prerequired) action to complete a related step.
 
 

UNDERSTANDING CUSTOMER VOICE

Form the Microsoft documentation pages, especially Data flow | Microsoft Learn, we learn the following

  • Customer Voice provides text-based surveys via forms
  • Surveys can be answered anonymously or on invitation
  • We can explore the tables in the PowerApps dataverse https://make.powerapps.com/
  • The tables can be accessed with the Dataverse Connector via PowerAutomate but Microsoft does not recommend using them for inserting data because this bypasses the backend services.
  • Table data can’t be deleted via Dataverse or the tables in PowerApps. The reponses will still reside in the reporting data of Customer Voice Delete responses: Frequently asked questions | Microsoft Learn
  • We cannot use the dataverse to create new entries.
  • To be able to create responses, we need to simulate the request used on the form

From playing around with Customer Voice, we've learned:

  • When customers respond to a form, the responses are sent to the backend using the following API request:
BASH

URL: https://customervoice.microsoft.com/formapi/api/< tenantid >/users/< userid > /forms('< formid >')/responses
Method: POST
Headers: __requestverificationtoken : < token created when acessing the form or after login (for surveys on invitation) >
Paylod: 
{
 "answers": "< response json >⁠",
 "startDate": "⁠< date in format yyyy-MM-dd >",
 "submitDate": "< timestamp >"
}

Example Payload:

JSON
{
    "answers": "[ 
                    { 
                        "questionId":"<questionid>",
                        "question": "Are you satisfied with our service?",
                        "answer1": "No"
                    },
                    {
                        "questionId":"<questionid>",
                        "question": "Do you want to provide feedback via one of the following channels?",
                        "answer1": "Leave a voice message"
                    },
                ]",
    "startDate": "2023-10-10",
    "submitDate": "2023-10-10T09:47:42.0544173Z"
}
 

Creating the Survey

  1. Go to https://customervoice.microsoft.com/ and create a project and a survey preferably using only yes/no branches or choices. Keep in mind, that customer will respond via the Nimbus IVR to it. 
  2. Note down the formId (from the url)

Example survey with just two simple questions:

Creating the Nimbus Workflow

  1. Create a parameter and name i.e. “CustomerVoice_SurveyFinished
  2. Create the workflow and re-create the survey path. For each question, add a "Input Customer" activity to the flow and its response outcomes accordingly.
  3. At each end, add a save parameter activity and add the responses json as the value to the parameter “CustomerVoice_SurveyFinished ”. 
    🔍 You can find the corresponding question Id’s by looking them up in the dataverse in Power Apps table "Customer Voice Survey Questions".

Creating the Power Automate Flow to Post Answers to a Survey

💡 We'll create a manually triggered flow that takes the content as input for the Parameters CustomerVoice_SurveyFinished and the formId of the survey.

The flow consists of 2 requests using a HTTP Element:

(1) open the survey page to get the cookies

(2) post the responses to the backend

(1) creates the request verification token that we need to send with request (2)

 Flow overview

 
 
Description
Screenshot

Start the manually triggered flow with two input variables of type string.

  1. The responsearry will take in the responses from the Nimbus IVR in json
  2. The formId will take the id of the survey

 

Add a "HTTP element" to the flow. Set 

 

Add a "Compose element" to the flow. We will store the cookies from the previous request and split the string with the ";" delimiter.

  • Inputs = split(outputs( 'HTTP_-_Open_Page' )[ 'headers/Set-Cookie' ], ';' )

 

💡 Now, we iterate through the cookies and search for one with name " __RequestVerificationToken".

Add a "Condition element" to the flow and set the fields to

  • contains(items( 'Apply_to_each' ), '__RequestVerificationToken' )
  • is equal to
  • true

 

💡 The corresponding string contains some additional information which we want to cut off.

Add a "Compose element" to the flow with

  • Input = split(items('Apply_to_each' ), '=' )[sub(length(split(items( 'Apply_to_each' ), '=' )), 1)]

→ This shouls output the __RequestVerificationToken.

 

Add a "HTTP Element" to the flow with the following settings:

CODE

{
 "accept": "application/json",
 "content-type": "application/json",
 "__requestverificationtoken": "@{outputs('__requestverificationtoken')}"
}
  • Body = 
CODE

{
 "answers": "@{triggerBody()['text']}",
 "startDate": "@{formatDateTime(utcNow(), 'yyyy-MM-dd')}",
 "submitDate": "@{utcNow()}"
}
  • Authentication = None

 

Add a "Respond to a PowerApp or flow" element to the flow so that you can re-use it in other flows.

 

Output variables are optional.

 

Creating the Power Automate Flow for the Nimbus Trigger

This second flow is the main cloud flow which listens to the Nimbus event Parameter Updated on the parameter CustomerVoice_SurveyFinished. Once trigegred, it will call child flow created in Step 3 flow to add the survey responses.

Description
Screenshot
Start the flow with the Nimbus trigger " GetOnUpdatedTasks" listening to the event "ParameterUpdated"

 

Add a Condition to the flow and check if the updated parameter was the one that you expect. Set the fields to

  • triggerOutputs()?['body/updatedParameterName']
  • is equal to
  • CustomerVoice_SurveyFinished

 

Finally add a "Run a Child Flowelement to the flow and select the flow created in step 3 with the following settigngs:

  • Child Flow = name of the flow from step 3
  • responsearray = @{triggerOutputs()?['body/updatedParameterValue']}
  • formId = <your survey form id>
  • Date = utcNow()

Testing

If you want to test this flow, make sure that you recreate a new survey for your production system. The survey responses cannot be deleted via the tables or UI. 

  1. Turn on your flows
  2. Call the service
  3. Make IVR choices
  4. Verify that the answers appear in the statistics https://customervoice.microsoft.com/ of your survey

Table of Contents