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
-
Navigate to Microsoft Power Automate.
-
Click "My Flows":
-
Click "New" and "Create from Blank":
-
Type "Recurrence" and provide the recurrence rate in seconds.
Note
Microsoft Power Automate limits the recurrence rate to a minimum of 60 seconds
-
Add action "Initialize variable" and rename it to "ThresholdSeconds"
-
Name = ThresholdSeconds
-
Type = Integer
-
Value = 300 (number of seconds after the notification should be send)
-
-
Add action "Initialize variable" and rename it to "HoursFromUTC"
-
Name = HoursFromUTC
-
Type = Integer
-
Value = 2 (number of hours )
-
-
Add action "Initialize variable" and rename it to "CurrentTime"
-
Name = CurrentTime
-
Type = String
-
Value = @{addHours(utcNow(),variables('HoursfromUTC'))}
-
-
Add action "HTTP"
-
Method = Get
-
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
-
-
Add action "Apply to Each"
-
Output = Body
-
-
Add Action "Parse JSON"
-
Content = "Current Item"
-
Schema =
CopyJSON{
"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"
}
}
}
-
-
Add action "Condition", with the following rules
-
Value 1:@body('Parse_JSON')?['Skill']
Check: is not equal to
Value 2:
-
Value 1: @body('Parse_JSON')?['AgentSipAddress']
Check: is equal to
Value 2: @null
-
Value 1: @addSeconds(body('Parse_JSON')?['InQueueSince'],variables('ThresholdSeconds'))
Check: is less then
Value 2: @variables('Current Time')
-
-
Add action "Send me an email notification" in the "If yes" flow
-
Subject = Queue threshold reached
-
Body = @{body('Parse_JSON')?['CustomerDisplayName']} waiting in the queue @{body('Parse_JSON')?['Skill']} for nore than 5 minutes.
-