Use Case - Creating a Callback Task in Dynamics 365

Ask caller if they want to be called back and automatically create a phone call activity in Microsoft Dynamics 365.

This Use Case describes the following situation:

  • In Nimbus, we want to ask the caller if he wishes to be called back (e.g., if they called outside of business hours, or if they don't want to keep waiting in the queue anymore).
  • 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:

Creating a "Callback"  as Phone Activity in Microsoft Dynamics 365

💡Instead, we can automate this by leveraging Nimbus Parameters and a Nimbus Power Automate Connector flow. 

 Overview of the flow

 
 

PRECONDITIONS

The Preconditions of our Nimbus Power Automate Connector apply (Nimbus Service set up, User Roles, Licensing).

✅ You also 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.


🔍 Related Concepts: Also 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

 

INC Icon Legend Accordion

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 parameters in Nimbus

First, we define two Parameters named "CallBackNumber" and "CallMeBack" which our workflow requires:

 

Adding a callback option to the Nimbus workflow

In this example, we're using an Input Customer activity in our Nimbus workflow to ask the caller whether they would prefer to keep waiting or rather leave the queue and be called back later instead.

We are using the Save to Parameter activity to store the caller's phone number and indicate that they specifically asked for a callback.

💡You can extend your workflow to be even more dynamic at this point, e.g. by first playing back the number that will be used for the callback as part of an announcement and asking the caller to confirm whether this is correct, or whether they would like to enter a different number instead (using the Collect Information workflow activity).

Creating the Power Automate Flow

We will now proceed with creating a new Power Automate flow that reacts specifically to the "CallMeBack" parameter being updated by the Nimbus workflow.

  1. Sign in to Power Automate at https://make.powerautomate.com/.
  2. Go to "My Flows".
  3. Click "+ New Flow" and create a blank "Automated Cloud Flow".
  4. Give your new flow a meaningful name, e.g., Schedule Callback.
  5. In the text box underneath, search for Luware Nimbus and choose the “When a task changes state” trigger.
  6. Click “Create”.

Configure the trigger

  1. Select the "When a task changes state" trigger.
  2. In the "Services" dropdown, select the Nimbus service's UPN.
    💡 You can also select multiple services.
  3. In the "Task Events" dropdown, select "Parameter Updated".
  4. Switch to the "Settings" tab and click "Add" (under "Trigger conditions".
  5. Enter @and(equals(triggerOutputs()?['body/updatedParameterName'], 'CallMeBack'),equals(triggerOutputs()?['body/updatedParameterValue'], 'True'))
    💡 This will ensure that the Power Automate flow only starts if the "CallMeBack" parameter is updated and only if its assigned value is "True".
    ☝ We are specifically monitoring updates to the "CallMeBack" parameter here as the "CallBackNumber" parameter may receive multiple updates within the Nimbus workflow until finalized.

Extract callback number

  1. Click and select "Add an action".
  2. Search for and select the "Filter array" action.
  3. Click into the "From" field and select “Task Information Custom Context Parameters”.
  4. Under "Filter Query", click into the left-side "Choose a value" field and choose "Insert Expression" and add the expression item()['Name']
  5. On the right side, enter "CallBackNumber" (or whichever name you chose for your parameter) in plain text.
  1. Next, click and select "Add an action" again.
  2. Search for and select the "Initialize variable" action.
  3. Set the name to "CallBackNumber".
  4. Set the type to "String".
  5. For the value, enter first(body('Filter_array'))?['Value'] as an expression.
 

Extract ContactId parameter value

✅ The "ContactId" parameter value 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. Click and select "Add an action".
  2. Search for and select the "Filter array" action.
  3. Click into the "From" field and select “Task Information Custom Context Parameters”.
  4. Under "Filter Query", click into the left-side "Choose a value" field and choose "Insert Expression" and add the expression item()['Name']
  5. On the right side, enter "ContactId" (or whichever name you chose for your parameter) in plain text.
  1. Next, click and select "Add an action" again.
  2. Search for and select the "Initialize variable" action.
  3. Set the name to "ContactId".
  4. Set the type to "String".
  5. For the value, enter first(body('Filter_array_1'))?['Value'] as an expression.
    ☝ Ensure that you reference the correct action name in the expression - the second "Filter array" action that we've added to this flow was automatically named “Filter array 1” by Power Automate in our example and needs to be referenced as “Filter_array_1” in the expression as well.
 

Check ContactId parameter value

Next we're checking whether the ContactId parameter actually has a value. If yes, we can continue with our actions targeted at Microsoft Dynamics. If not, we can end the flow here.

  1. Click and select "Add an action".
  2. Search for and select the "Condition" action.
  3. Select your ContactId variable as the left-hand value to check.
  4. Select “is greater than” for the comparison.
  5. Leave the right-hand value empty.

Get Contact and Create Phone Call Activity

If the ContactId parameter has a value, the Flow will execute the next actions listed under “True”.

  1. Click under the Condition's “True” section.
  2. Add a “Get future time” action.
  3. Set the “Interval” to “1”.
  4. Set the “Time unit” to “Day”.
  1. Click and add a “Get row by ID” action from the “Microsoft Dataverse” connector.
  2. Select the “Contacts” table
  3. Set the “ContactId” variable as the Row ID
  1. Click and add a “Add a new row ” action from the “Microsoft Dataverse” connector.
  2. Select the “Phone Calls” table
  3. Set the Subject to whatever you like
  4. You can use the following expressions to format the timestamps in your description
    1.  formatDateTime(triggerOutputs()?['body/created'],'dd.MM.yyyy')
    2. formatDateTime(triggerOutputs()?['body/created'],'HH:mm')
  5. Insert the “Future time” output from the previous action under “Due
  6. Insert “Caller Telephone Number” under “Phone Number
  7. Insert “OData Id” under "Regarding (Contacts)" to establish the relation with the Dynamics contact.

Testing your Use Case

  1. Call the service line
  2. Wait for the announcement and press "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