Author Message
andywfinlay
Joined: Jan 24, 2017
Messages: 30
Offline
what is the best way to grab only the time from the CallEvent ["timeOfEvent"].

the format is 'timeOfEvent':'2018-12-06 13:13:27

I am pretty sure this regex \d{2}:\d{2}:\d{2} will get me 13:13:27 but not sure how to get this and save it in a new variable.
I tried this:

CallEvent["timeOfEvent"].replace(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}, \d{2}:\d{2}:\d{2})

also tried
currentTime["TimeOfDay"]==Call["timeOfEvent"].replace(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}, \d{2}:\d{2}:\d{2})

the currentTime["TimeOfDay"] is a separate variable.

I am trying to figure out a way to route in ED based on time of call compared to time of day. maybe there is an easier way.

syntax on either of those is wrong. doing this in Engagement Designer.
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
Andy,

It should be straight forward substring function.

In Assign or Data Manipulation task, substring the original timeOfEvent string to two different strings:
timeOnly = timeOfEvent.substring(0, 10)
dateOnly = timeOfEvent.substring(11)

Please see the attached document where I have put some screenshots. And also I have attached the workflow that I created.
Filename ForAndy.xml [Disk] Download
Filename ForAndy.docx [Disk] Download

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
Andy,

Please find new set of attachments where I have built the flow with 3.4 and the screenshots from it. We did not have the Data Manipulation task back in 3.4. We had Assign task. It is a bit messy task, that is why we came up with Data Manipulation task starting 3.5 release. In fact, you don't even need this Assign or Data Manipulation task to do this. You can do it on any Output Data Mapping of any task.
Filename ForAndy_3.4.docx [Disk] Download
Filename ForAndy_3.4.xml [Disk] Download

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
Go to:   
Mobile view