Example configuration Microsoft Power Automate to send a notification whenever a customer is in queue for longer than x amount of seconds

Introduction

This example shows you how you can use Microsoft Power AutomatePreviously named Microsoft Flow. to automatically send you a notification whenever the threshold for a customer to be in queue is reached.

 

Configuration

  1. From your Office Portal, go to your Power Automate App:

  2. Click "My Flows":

  3. Click "New" and "Create from Blank":

  4. Type "Recurrence" and provide the recurrence rate in seconds.

    Note Microsoft Power Automate limits the recurrence rate to a minimum of 60 seconds

  5. Add action "Initialize variable" and rename it to "ThresholdSeconds"

    1. Name = ThresholdSeconds

    2. Type = Integer

    3. Value = 300 (number of seconds after the notification should be send)

  6. Add action "Initialize variable" and rename it to "HoursFromUTC"

    1. Name = HoursFromUTC

    2. Type = Integer

    3. Value = 2 (number of hours )

  7. Add action "Initialize variable" and rename it to "CurrentTime"

    1. Name = CurrentTime

    2. Type = String

    3. Value = @{addHours(utcNow(),variables('HoursfromUTC'))}

  8. Add action "HTTP"

    1. Method = Get

    2. URI = http(s)://{fqdnA fully qualified domain name (FQDN), sometimes also referred as an absolute domain name, is a domain name that specifies its exact location in the tree hierarchy of the Domain Name System (DNS).}/dashboardservice/api/{uccname}/calls

  9. Add action "Apply to Each"

    1. Output = Body

  10. Add Action "Parse JSON"

    1. Content = "Current Item"

    2. Schema =

      {

      "type": "object",

      "properties": {

      "CurrentlyHunting": {},

      "AgentDisplayName": {},

      "CustomerDisplayName": {},

      "HuntList": {

      "type": "array"

      },

      "HuntListDisplayName": {

      "type": "array"

      },

      "IsHunting": {

      "type": "boolean"

      },

      "IsOnHold": {

      "type": "boolean"

      },

      "SkillType": {},

      "SessionType": {

      "type": "string"

      },

      "CallId": {

      "type": "string"

      },

      "Skill": {

      "type": "string"

      },

      "CustomerSipAddress": {

      "type": "string"

      },

      "AgentSipAddress": {},

      "ConnectedSince": {

      "type": "string"

      },

      "InQueueSince": {

      "type": "string"

      },

      "AcceptedSince": {

      "type": "string"

      },

      "DisconnectedSince": {

      "type": "string"

      }

      }

      }

  11. Add action "Condition", with the following rules

    1. Value 1:@body('Parse_JSON')?['Skill']

      Check: is not equal to

      Value 2:

    2. Value 1: @body('Parse_JSON')?['AgentSipAddress']

      Check: is equal to

      Value 2: @null

    3. Value 1: @addSeconds(body('Parse_JSON')?['InQueueSince'],variables('ThresholdSeconds'))

      Check: is less then

      Value 2: @variables('Current Time')

  12. Add action "Send me an email notification" in the "If yes" flow

    1. Subject = Queue threshold reached

    2. Body = @{body('Parse_JSON')?['CustomerDisplayName']} waiting in the queue @{body('Parse_JSON')?['Skill']} for nore than 5 minutes.