IVR checking Data Tables to get hour of operation inside flows

Hi Everybody!

As far as I know, Schedules and Schedule Groups features on PC can be checked before an interaction get inside a flow, but not from inside them...
Currently, when we need to check date/time inside a flow to make decisions, we've been using expressions.

I've been struggling to find a way to use a data table as a schedule table, so the IVR would check open hours for one or several specific services inside a flow and when needed, any PC admin could go to the data table and, for example, extend the hours of operation for the service(s).
This feature is specially important for us right now since we are implementing a customer that has more than 50 flows and sometimes they need to change the open hours for some or all of them at the same time, and this schedule must be checked inside flows.

Can I get a help on how to implement that? Or if you guys have a better suggestion, I'd appreciate to hear.

Thanks a lot,
Rafael

Looks like the Data Table has an issue.
The call goes through the flow until it hits the Data Table Lookup action then a system message says "Sorry, an error occurred. Please try again."

The expression I'm using is:
(Hour(GetCurrentDateTimeUtc()) > Task.Start_Time and (Hour(GetCurrentDateTimeUtc()) < Task.End_Time))

Thanks!

I was working on a similar project and during my research came across this thread. Thanks for providing me the insights and now I know exactly what to do.

1 Like

Not sure if it may help, but this is a sample of an interaction that was disconnected by the flow when reached the Data Table Lookup action.

{
"conversationId": "e0eb202e-7342-4710-b41c-225edfe79bca",
"conversationStart": "2019-09-16T14:49:46.898Z",
"conversationEnd": "2019-09-16T14:50:02.539Z",
"mediaStatsMinConversationMos": 4.393022537231445,
"mediaStatsMinConversationRFactor": 92.11856842041016,
"originatingDirection": "inbound",
"participants": [
{
"participantId": "124de08d-67c7-40c9-9cf4-87ebaec02661",
"participantName": "RAFAEL ANDRADE ",
"purpose": "external",
"sessions": [
{
"mediaType": "voice",
"sessionId": "7ef756ad-026c-4f04-ad56-548c64c4e538",
"ani": "tel:+14379843191",
"direction": "inbound",
"dnis": "tel:+14168747520",
"sessionDnis": "tel:+14168747520",
"edgeId": "e2da410b-56f4-4353-941b-2fe6ee1b89c7",
"remoteNameDisplayable": "RAFAEL ANDRADE ",
"segments": [
{
"segmentStart": "2019-09-16T14:49:46.909Z",
"segmentEnd": "2019-09-16T14:49:47.567Z",
"segmentType": "system",
"conference": false
},
{
"segmentStart": "2019-09-16T14:49:47.567Z",
"segmentEnd": "2019-09-16T14:50:02.539Z",
"disconnectType": "peer",
"segmentType": "interact",
"conference": false
}
],
"metrics": [
{
"name": "nConnected",
"value": 1,
"emitDate": "2019-09-16T14:49:47.567Z"
}
],
"mediaEndpointStats": [
{
"codecs": [
"audio/opus"
],
"minMos": 4.874869346618652,
"minRFactor": 92.11856842041016,
"maxLatencyMs": 30,
"receivedPackets": 750
},
{
"codecs": [
"audio/PCMU"
],
"minMos": 4.393022537231445,
"minRFactor": 92.38813781738281,
"maxLatencyMs": 30,
"receivedPackets": 746
}
],
"recording": true,
"protocolCallId": "117455ea-5334-1238-98af-0cc47a0b7722",
"provider": "Edge"
}
]
},
{
"participantId": "e4c5189b-d78c-42d7-94aa-2576723dfc80",
"participantName": "Toronto ON",
"purpose": "ivr",
"sessions": [
{
"mediaType": "voice",
"sessionId": "dbee3cc0-9d7e-41af-90e6-048200107733",
"ani": "tel:+14379843191",
"direction": "inbound",
"dnis": "tel:+14168747520",
"sessionDnis": "tel:+14168747520",
"edgeId": "20c02735-92b4-4542-8f9d-e86442611a92",
"remoteNameDisplayable": "Toronto ON",
"peerId": "7ef756ad-026c-4f04-ad56-548c64c4e538",
"segments": [
{
"segmentStart": "2019-09-16T14:49:47.498Z",
"segmentEnd": "2019-09-16T14:49:47.520Z",
"segmentType": "system",
"conference": false
},
{
"segmentStart": "2019-09-16T14:49:47.520Z",
"segmentEnd": "2019-09-16T14:50:02.531Z",
"disconnectType": "system",
"segmentType": "ivr",
"conference": false
}
],
"metrics": [
{
"name": "nFlow",
"value": 1,
"emitDate": "2019-09-16T14:49:47.659Z"
},
{
"name": "tIvr",
"value": 15011,
"emitDate": "2019-09-16T14:50:02.531Z"
},
{
"name": "tFlow",
"value": 14874,
"emitDate": "2019-09-16T14:50:02.533Z"
},
{
"name": "tFlowDisconnect",
"value": 14874,
"emitDate": "2019-09-16T14:50:02.533Z"
}
],
"flow": {
"flowId": "8497ec53-88e4-42e7-b2c3-206a0d77599c",
"flowName": "Rafael Test Schedule Data Table 2",
"flowVersion": "2.0",
"flowType": "INBOUNDCALL",
"exitReason": "FLOW_ERROR_DISCONNECT",
"entryReason": "tel:+14168747520",
"entryType": "dnis",
"issuedCallback": false,
"startingLanguage": "en-us",
"endingLanguage": "en-us"
},
"protocolCallId": "07ce0340-6891-4156-a526-7a7502ccbe89",
"provider": "Edge"
}
]
}
],
"divisionIds": [
"e60249cc-5199-4d13-9533-858aed9838b1"
]
}

@rafaelandradec You need to open a ticket with support.

1 Like

It does not look like your input query will match row 1 on the table.

Try making the row key key and the architect input a fixed value, such as a simple '1' and then return the start and end time and THEN determine if the current time is inside or outside those.

For scheduling in a flow i usually hard code the times into the flow ala a large switch, to allow for 7-day scheduling.

Soon, I have heard, Architect will receive a toolbox item to parse schedules from teh admin UI.

Also, the flow times are in UTC to make sure to adjust your 8 and 20 accordingly. Or do an addhour(flow.callstarttimeutc,-X) where X is your UTC offset.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.