Create expression to identity date and time

Hi all, I'm looking to create a decision expression that looks at the schedule of two groups and if the time falls in-between either of the schedules to transfer to the appropriate group.

Take a look at the Visio below:

Are you wanting to implement this in Architect?

Yes this is something I want do do for the inbound call flow.

You're going to use a Decision action and the Hour, Minute, and GetCurrentDateTimeUtc functions. The GetCurrentDateTimeUtc returns the current time in UTC. You need to know your timezone offset and take that into account when constructing the expression. Here's an example expression for checking if the time is between 9:00 am and 4:30 pm CET:

Hour(GetCurrentDateTimeUtc()) >= 8 and (Hour(GetCurrentDateTimeUtc()) <= 15 and Minute(GetCurrentDateTimeUtc()) <= 30)

CET is 1 hour ahead of UTC, so that's why I used 8 instead of 9. For the afternoon hours, you need to convert 4:30 into the 24 hour format to get 16:30, then subtract 1 hour to get 15:30.

CST is 6 hours behind UTC, so 7am to 7pm is 1pm to 1am in UTC. Notice this expression uses or instead of and.

Hour(GetCurrentDateTimeUtc()) >= 13 or (Hour(GetCurrentDateTimeUtc()) <= 1 and Minute(GetCurrentDateTimeUtc()) == 0)

Here's a sample task using these expression. I only did the leftmost Yes branch of your picture.

I did not take Daylight Savings Time into account in this example. If that's something you will need to consider, see https://help.mypurecloud.com/articles/datetime-values-in-architect-flows-and-daylight-savings-time-dst-calculations/

1 Like

Wow thank you for this! This really helps with my deployment.

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