Introduction

In this article you will learn how you can Create a Task in Microsoft Dynamics when a CustomerGauge survey gets completed using our Outgoing Webhooks Functionality. This real-time data sync is perfect if your organization is Closing the Loop using Microsoft Dynamics


In order to leverage this Outgoing Webhooks you do need to be a customer of both Microsoft Dynamics and CustomerGauge.


Tasks can be created in Dynamics whenever a Survey gets completed




Preparations

Requirements

In order to set up an Outgoing Webhook to Microsoft Dynamics, you'll need the following:

  • Admin access in CustomerGauge;
  • Access to Azure Active Directory "App Registrations";
  • Admin access in Microsoft Dynamics.



Authentication

Each of the recipes for Microsoft Dynamics will require a valid authentication. You should follow the steps as described below for each of your Outgoing Webhooks to Microsoft Dynamics.

  1. Head over to the App Registrations page in Azure Active Directory and do a New Registration.
    1. Name: Give a descriptive name for the App, such as "CustomerGauge Integration".

    2. Supported Account Types: Accounts in this organizational directory only (Single tenant).

    3. Redirect URL: Keep this field blank.

    4. Save your App: Click the Proceed button - this will save your App.

    5. Create a Client Secret: Head to  the Certificates & Secrets section in your App, and create a new Client Secret. Save the Value somewhere secure - you will not be able to obtain it at a later stage!
    6. Copy Client ID: Copy the Application (client) ID of the app you just created.

    7. Do not close the registered app: There are details on this page that you'll need later on.

  2. Head over to Advanced Settings of your Dynamics environment. This can be accessed by pressing the cog wheel icon at the top right corner, followed by Advanced Settings.
    1. Go to Security Roles: You're now at the Business Management screen, open the Settings drop-down in the top menu bar. Then press "Security", followed by "Security Roles".

    2. Create a new role: Press the "New" button and give your Role a descriptive name, such as "CustomerGauge Integration User", and hit the Save icon at the top.

    3. Set Permissions: In each of the tabs, set the permissions as needed, and press "Save & and Close".
  3. Head over to Security → Usersin the Advanced Settings of your Dynamics environment.
    1. Go to Users: Navigate back to "Security", followed by "Users".

    2. Go to Application Users: Press Omnichannel Users, and select "Application Users" from the drop-down.

    3. Create New User: Press the "+ New" button at the top-left of the screen, paste your Application (Client) ID in the Application ID field, and click Save. Once saved, the rest of the form will be filled in.

    4. Assign the Role: Press the Manage Roles button, and select the role you just created, and press OK.

  4. Head over to CustomerGauge, navigate to Data → Integrations → Webhooks → Authentications, and create a new Authentication.
    1. System: Select Microsoft Dynamics from the drop-down.

    2. Name: Give your Authentication a name that you'll recognize in the future.

    3. Directory (tenant) ID: Copy/paste the Directory (tenant) ID from your registered app in Azure Active Directory. This can be found in the Overview tab of your registered app.

    4. Client ID: Copy/paste the Application (client) ID from your registered app in Azure Active Directory. This can be found in the Overview tab of your registered app.

    5. Client Secret: Copy/paste the Client Secret you've obtained as part of your app registration in Azure Active Directory.

    6. Dynamics Domain: Add the domain of your Dynamics system. You can obtain this when in your Dynamics environment, and copying this from the URL in your browser.
      Copy the selected part of the browser URL when in your Dynamics environment.

    7. Save: Press the Save button - you're now ready to set up your Outgoing Webhook!




Create a Task when a Survey gets completed


How to set-up

  1. In CustomerGauge, in the Outgoing Webhooks page, click the New Webhook button, followed by the Outgoing option.

  2. In the Filters step you can add a combination of fields and their value that a survey response needs to match in order to trigger the Webhook.
    Survey Responses that have Touchpoint "Support", and Area being either "British Isles" or "Benelux" qualify to trigger this Webhook.


  3. In the Authentication step, select your Authentication from the drop-down.

  4. In the API Setup step you'll need to set up your API request. We'll walk you through each of the fields that you'd need to fill in to create a Task in Dynamics.
    1. Method: POST

    2. API URL:
      https://example.crm4.dynamics.com/api/data/v9.0/tasks
    3. Custom Headers: Add the following Custom Headers to the request:
      HeaderValue
      Content-Typeapplication/json; charset=utf-8
      OData-MaxVersion4.0
      OData-Version4.0
      Acceptapplication/json

      When set up, your Custom Headers should look like this.

    4. Request Body: The Request Body is used to send your Survey Response data to Dynamics. Think of this as the mapping between CustomerGauge and Dynamics. Microsoft Dynamics' capabilities can be explored here.


  5. In the Activation step, the last step, you need to decide to Activate the Webhook immediately or not. Once you've done that, click the Save button, and you're all done! You can see whether your Webhook being (de-)activated in the Status column in the overview of Webhooks. If you'd like to activate or deactivate your Webhook at a later time you can always Edit your Webhook and navigate to the Details step to activate or deactivate it.