PhillipCoronakes | 2017-04-10 04:55:02 UTC | #1
Hi,
I current have an expression at a decision (yes/no) on an inbound call flow that looks at the time of the day: Hour(Flow.StartDateTimeUtc)==20
Basically it decides where to route the call if it is between 6-7am.
How do i add minutes into the equation? so it would detect the time of 6:30-7am?
Regards, Phill
tim.smith | 2017-04-10 16:11:14 UTC | #2
Add a minute comparison: Hour(Flow.StartDateTimeUtc) == 20 and Minute(Flow.StartDateTimeUtc) >= 30
PhillipCoronakes | 2017-04-10 21:02:08 UTC | #3
Thank you Tim!
Are there any tools i can use to check expressions?
tim.smith | 2017-04-10 22:40:16 UTC | #4
The expression editor validates your expression:
<img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/d68197d350c28c921a00298fc762740559f801f0.png" width="536" height="500">
PhillipCoronakes | 2017-04-10 22:52:41 UTC | #5
Sorry, i meant if there are any tools to run a test against the expression.
PhillipCoronakes | 2017-04-19 02:44:44 UTC | #6
Hi Tim,
I've tried this and it doesn't seem to be liking the comparison. If i place the first part only, it works. eg. Hour(Flow.StartDateTimeUtc) == 20 But if i add both sections, it doesn't work.
I also tried to add () but its still not working. eg. (Hour(Flow.StartDateTimeUtc) == 20) and (Minute(Flow.StartDateTimeUtc) >= 30) and also tried ((Hour(Flow.StartDateTimeUtc) == 20) and (Minute(Flow.StartDateTimeUtc) >= 30))
Apologies for my ignorance with my expression knowledge.
Regards, Phill
MelissaBailey | 2017-04-19 16:19:32 UTC | #7
Add a play audio action before evaluating the expression that will play the hour & minute values. Keep in mind this expression will only be true if you're making the call between 6:30 and 6:59. If you aren't paying attention to the time and make the call at 7:02 then it should be false.
Ullyot_Jim | 2017-04-19 16:32:41 UTC | #8
Assuming your call flow is running in a language with TTS support, on the Play Audio action action this is a way to do that:
Append(ToAudioTTS("The hour integer value is"), ToAudioNumber(Hour(Flow.StartDateTimeUtc)), ToAudioTTS(" and the minute integer value is "), ToAudioNumber(Minute(Flow.StartDateTimeUtc)))
additionally you could do audio expressions like this too when narrowing down what the issue is:
Append(ToAudioTTS("Is the hour value 20?"), ToAudioBlank(1000), ToAudioBool(Hour(Flow.StartDateTimeUtc) == 20, Format.Bool.playYesNo))
system | 2017-08-28 19:33:43 UTC | #9
This post was migrated from the old Developer Forum.
ref: 1164