All Collections
Integrations
Webhooks and REST APIs
Microsoft Dynamics: Trigger surveys using Webhooks
Microsoft Dynamics: Trigger surveys using Webhooks

Send surveys automatically with Microsoft Dynamics via email, SMS or loading in-app

Daniel Pitrowiski avatar
Written by Daniel Pitrowiski
Updated over a week ago

Webhook triggers allow you to set up Flows in Microsoft Dynamics to

Send surveys by configuring Flows in Microsoft Dynamics. For example, this can allow you to send a survey to customers after resolving a case.

For example, as a new case flows through your customer service team's process you can send them a survey when their case is resolved (e.g., How satisfied are you with the agent who assisted you? How easy was it for you to resolve your issue? etc.)

Setting Up Dynamics Webhooks

Below we'll be going through the example of setting up an Automated Cloud Flow trigger that will automatically trigger when you resolve a case in your Customer Service app. When we're done with the example, a survey will send to all resolved cases.

1. Start by logging in to Microsoft Power Apps.

This is the app that allows you to configure options in Dynamics. You can log into Power Apps with your Dynamics email and password.

2. Go to the Flows page.

3. In the "+ New flow" dropdown add an "Automated cloud flow" from the dropdown.

There are other types of flows where you can use webhooks. For this guide, we'll be following just one example. Hopefully, the example will be illustrative of how other Flows could be configured.

4. Choose a trigger for your flow (any trigger can work).

  1. Choose the name of your flow. For us, we'll name it, "Send survey when case is set to resolved".

  2. There are many options for how to trigger a survey, and for this example, we're using the trigger "When a row is added, modified or deleted" for the Microsoft Dataverse app.

5. Select the trigger to start your new Flow.

For our example, search for When a row is added, modified or deleted or just scroll down the list of Triggers to find it. Select it.

We're going to create an automatic trigger that happens when a case is modified to Resolved. This means when your Customer Service team finishes an issue with a customer, the customer can immediately receive a survey to give you feedback while the experience is still fresh.

6. Complete the options for your trigger.

For our example, we're saying the trigger will happen when the Cases table is modified in the scope of our Organization.

7. Add the "+ New step".

8. We need to use another table to connect Case to your customers. For this next step, add the "Get a row by ID".

9. Select your "Accounts" table and choose "Customer (Value)" as the Row ID we're using.

10. Add a "+ New Step" and select "Condition".

This is where we'll set the Flow to send a survey if a Case is set to Resolved or to not do anything.

11. Search for "Status" for "When a row is added, modified, or deleted"

For the condition, we're looking to make this condition trigger ONLY when the case status is set to Resolved.

If you want to, you can go find how Resolved is stored in your tables. You would need to go to Dataverse / Tables - tab into All / Cases / Edit the Status column in the Cases table. It's a long way to go. But the most important part you need to know is the graphic below.

  • Active = 0

  • Resolved = 1

  • Cancelled = 2

For the rule we can set it to work when:

Status is equal to 1

This means only when the Status of the Case is modified to Resolved, will the survey get sent.

12. Choose "Add an action" for Yes, and we'll leave No empty.

13. Choose HTTP from the list of Actions

For sending surveys, select the Subscribe - Method as POST.

For the Subscribe - URI, we'll need to go back into your Wootric Settings. Go to Settings >> Integrations >> Trigger Surveys >> Microsoft Dynamics.

For our example, we're going to copy the link for email surveys. Paste that URL into the field in Microsoft Dynamics above that is Subscribe - URI.

14. Configure the Body for the webhook

All of the parameters inside the Body are dynamic content you can enter yourself. Below is just an example of using the Email Webhook.

  • Email is required for email surveys.

  • Customize your email subject as seen below and add dynamic content like: "Please give us feedback on case {#12345}"

  • Customize your survey intro as seen below. Example: "Thank you so much {first.name} for giving us feedback."

  • All other parameters passed along in the webhook will be created as properties in your dashboard.

  • If you are testing an SMS survey you will need to include a list of "phone_numbers" rather than a list of "emails".

The example below is the exact same setup as above for reference, just written in the MS Dynamics code.

{
"emails": [
"@{outputs('Get_a_row_by_ID')?['body/emailaddress1']}"
],
"subject": "Test Subject @{outputs('Get_a_row_by_ID')?['body/name']}",
"intro": "Test Intro @{triggerOutputs()?['body/title']}",
"Case Number": "@{triggerOutputs()?['body/ticketnumber']}",
"Status": "@{triggerOutputs()?['body/statecode']}",
"Status Reason": "@{outputs('Get_a_row_by_ID')?['body/statuscode']}"
}

15. Save your Flow and it's done! πŸŽ‰

Your Flow and webhook is now live. Customer Service will now send out surveys whenever they resolve a case.

If you're not ready to go live yet, you can turn a flow OFF in the Flows page as seen below.

Did this answer your question?