Use Case - Creating a Callback Task in Dynamics 365

Ask caller if they want to be called back when calling during closed hours, and automatically create a phone call activity in Microsoft Dynamics 365 if they wish to be called back.

This use case describes the following situation:

  1. In Nimbus, when a call comes in during the closed office hours, we want to ask the caller if he wishes to be called back.
  2. If the caller chooses to be called back, we automatically create a Phone Call activity in Microsoft Dynamics 365 to the related contact.

If we would do this manually, this is how it would look like:

Instead we can use a variable in Flow, filled with an input from the Nimbus caller to automatically switch the case. 

 Overview of the flow

 
 

PRECONDITIONS

✅ You want to implement the following flow: Use Case - Looking up a caller to open Dynamics 365 contact context to see the caller's information in Nimbus and also to get the contactid of a caller from Microsoft Dynamics when the call comes in. We use that id to create the relation between the call back task and the contact in Dynamics.


🔍 Read about what other items you can create automatically in Microsoft Dynamics 365 Sales Hub: https://docs.microsoft.com/en-us/dynamics365/customer-service/automatically-create-update-records?tabs=customerserviceadmincenter

 

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.
 
 

How-To Steps

Create the parameter in Nimbus

✅ We need to create the parameter in Nimbus first.

In Nimbus, we need to go to Configuration > Parameters and create the following Custom Parameters to store the Choice of the caller into:

  • CallMeBack false

Create the workflow

✅ We need to create the workflows that writes into our new parameter.

  1. Still within Nimbus Configuration, go to Workflows and create a new workflow as follows: 
  2. Start with an "Accept Conversation" activity followed by "Collect Information" and "Check Parameter". Afterwards drag in the other activities (e.g. announcements) as needed. 💡 We omitted an "Check Opening Hours" for testing reasons.
  3. In the "Collect Information" activity, adjust the settings as follows:
    1. Select "CallMeBack" as parameter to save
    2. Limit Max DTMF Digits to "1" 
  4. In the "Check Parameter" activity, adjust settings as follows:
    1. Select Parameter Type "Custom"
    2. Select Custom Type "Custom Context Parameter"
    3. Use "CallMeBack" as parameter
    4. Add a Regular Expression "^1$" to the Regex field: without the quotes. 
      💡 This expression checks if input begins with 1, ends right after. 
       
  5. Finally, assign the workflow to your service line.

Create the Flow

✅ Ensure you are working in the right environment. 

Now it's time to create a new flow:

  1. Within Power Automate click on Create > Automated Cloud Flow
  2. Name your flow accordingly, like “When a caller wishes to be called back, then create a call back task in Microsoft Dynamics 365”
  3. Start your flow with the a "GetOnUpdatedTasks" Nimbus activity.
  4. Select SessionEvent to "Parameter Updated".

Check for “Updated Parameter”

  1. Drag an "Initialize variable" element to the flow into which we want to store the caller's contact ID stored during the incoming call Power Automate flow.
    • Name = contactid
    • type = String
  2. We now check if the event corresponds to the update of the CallMeBack parameter and if the caller has chosen to be called back. The parameter's default value was "false" so we want to go further if that has changed. 
    Drag a "Condition" element to the flow and set the following:
    1. UpdatedParameterName is equal to CallMeBack
    2. UpdatedParameterName is not equal to false

IF TRUE Condition 1: check DynamicsContactId parameter

💡 If the flow runs into this branch, then CallMeBack has changed its value from false to something else. We remember that 1 was the choice of being called back in the Nimbus workflow. For simplicity here we do not differentiate the value. 

💡 We can set the contactid variable to see if the contact is known in Microsoft Dynamics 365. ✅ The id had been set by the flow Use Case - Looking up a caller to open Dynamics 365 contact context which is the precondition to this flow.

  1. Element "Set variable"
    • Name contactid
    • Value triggerOutputs()?['body/customContectParameter/DynamicsContactId']
  2. Element "Condition 2"
    • contactid "is greater than" null

IF TRUE Condition 2: get the Microsoft Dynamics contact

💡 If the flow runs into this branch, then a contactid had previously been found in Microsoft Dynamics and we can use it to get the data of the contact.

  1. Add a "Get future time" element to the flow:
    • Set the interval to1
    • Set the time unit to Day.
  2. Add a Dataverse "Get row by Id" element to the flow:
    • Rename it to "Contact"
    • Table name = Contacts
    • Row ID contactid variable

Create the Phone Call activity in Microsoft Dynamics 365

  1. Finally add a Dataverse "Add a new row" element to the flow and set it as following:
    1. Description: Use formatDateTime() to correctly format timestamps from the Nimbus object:
      • formatDateTime(triggerOutputs()?['body/created'],'dd.MM.yyyy')
      • formatDateTime(triggerOutputs()?['body/created'],'HH:mm')
    2. The Regarding XYZ fields need the "odata.id" as input of the related object. 
      💡 In our case it is the OData Id of the Contact element.

Testing your Use Case

  1. Call the service line
  2. Wait for the announcement and type "1#" on your phone
  3. Open Microsoft Dynamics 365 and verify that a call back item has been created at the according contact. 
    💡 You'll see it in the Timeline of the contact or in the Related section.

Table of Contents