On Premises

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

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

Configuration

  1. Navigate to Microsoft Power Automate.

  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)://{fqdn FDQN stands for Fully Qualified Domain Name and specifies the exact location in the tree hierarchy of the Domain Name System (DNS). An example for [hostname].[domain].[top level domain] is [www].[microsoft].[com]}/dashboardservice/api/{uccname}/calls

  9. Add action "Apply to Each"

    1. Output = Body

  10. Add Action "Parse JSON"

    1. Content = "Current Item"

    2. Schema =

      Copy
      JSON
      {
         "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.