Example configure MS Flow for last agent routing

Introduction

This example shows you how you can use Microsoft Flows for Last Agent Routing.

 

Configuration

Configure CallSummary on SharePoint

On the UCCUCC stands for Unified Contact Center and consists of a queue that can be handled by Agents Each Contact Center has its own settings, interactive voice response questions and Agent with specific skills. Agents can be member of, or sign up to, one or more Contact Centers. Configuration page on SharePoint, enable WriteSummaryToSharePoint. This will enable the CallSummary list.

 

Create a Microsoft Flow

  1. From your Office Portal, go to your Flow App:

  2. Click "My Flows":

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

  4. Select connector "SharePoint, When an item is created":

  5. When call is ended and entry is written in CallSummary list

  6. Get all parent questions that match ‘Question <sipaddress agent>’

    concat('Title eq ''Question ',triggerBody()?['wsp_ucc_InitialAgent'],'''')

  7. Compose a variable to count the number of matching IVRInteractive Voice Response (IVR) is a telephone application to take orders via telephone keypad or voice through a computer. By choosing menu options the caller receives information, without the intervention of a human operator, or will be forwarded to the appropriate Agent. Questions

    length(body('Get_ParentQuestion')?['value'])

  8. If a total of 1 IVR Question is found continue

  9. Get routing items that match customer

    If customer called using phone convert phone number into sipThe Session Initiation Protocol (SIP) is a protocol to make multimedia communication (audio, video and other data communication) possible and it is also used for Voice over IP (VoIP). SIP has similarities with other Internet protocols such as HTTP and SMTP. address; otherwise use customer sip address

    tel:+31123456789 => sip:+31123456789@domain.com

    sip:customer@domain.com => sip:customer@domain.com

    if(equals(substring(triggerBody()?['wsp_ucc_Customer'],0,3),'tel'),concat('wsp_ucc_routing_match_from eq ''','sip:',substring(triggerBody()?['wsp_ucc_Customer'],4,sub(length(triggerBody()?['wsp_ucc_Customer']),4)),'@vfanywhere.nl'''),concat('wsp_ucc_routing_match_from eq ''',triggerBody()?['wsp_ucc_Customer'],''''))

  10. Compose a variable to count the number of matching Routing Items

    length(body('Get_RoutingItems')?['value'])

  11. If number of Routings found is 0 continue

  12. For each IVR Question found (which is limited to 1 by the first condition in this flow)

  13. Create a Routing Item

    Title:

    concat('Customer ', triggerBody()?['wsp_ucc_Customer'])

    Match From:

    if(equals(substring(triggerBody()?['wsp_ucc_Customer'],0,3),'tel'),concat('sip:',substring(triggerBody()?['wsp_ucc_Customer'],4,sub(length(triggerBody()?['wsp_ucc_Customer']),4)),'@vfanywhere.nl'),triggerBody()?['wsp_ucc_Customer'])

    Action Value: Question

    Active: Yes

    ExactMatch: Yes

    PartenQuestion Id: items('Apply_to_each')['ID']

    MatchEndpoint: ALL

    Order: 1

    Content type Id: UCCRouting

  14. Finally, remove the call summary item that triggered the flow

 

Result

If all steps are followed, you will have the following flow: