Skip to main content
Solved

assystETM - importing start and end times for SLA Header


Forum|alt.badge.img

Greetings, everyone!

I need to import start and end times for SLA Headers via assyst ETM (database table sla - SLA Header Details, fields mon_start, mon_end, tue_start, tue_end and so on). My channel is defined with source = Directory and message format = CSV.

What is the JavaScript expression to parse my input data? Please consider date/time format as “dd/mm/yyyy hh:mi:ss”, where dd = day (two digits), mm = month, yyyy =  year (four digits), hh = hour (zero to 23, not AM/PM), mi = minutes and ss = seconds.

Thank you.

Best answer by SGrant89

https://wiki.axiossystems.com/assyst11-4Wiki/index.php/Integrations:assystETM_1.5_-_Data_Mapping#common

Hi Mauro,

We have some common JavaScript functions available to Datamapper authors as linked from the wiki above. The key one for this would be common.parseDate(dateString, dateFormat). It takes the date value from your input, along with the target format (As described in Java SimpleDateFormat) to return a Date value.

In use, if we have a CSV file like:

mon_start mon_end ...
01/01/2022 09:00:00 01/01/2022 17:30:00 ...

 

Our Datamapper could have a field mapping to the “Mon Start” field for an SLA, with the following JavaScript expression:

common.parseDate(inbound["mon_start"],'dd/MM/yyyy HH:mm:ss');

Which would look like this in the UI (With “Debug” running to show the result from the above CSV file)

Hope this helps!

View original
Did this topic help you find an answer to your question?

2 replies

SGrant89
Hero (Employee)
Forum|alt.badge.img+6
  • Hero (Employee)
  • 22 replies
  • Answer
  • September 1, 2022

https://wiki.axiossystems.com/assyst11-4Wiki/index.php/Integrations:assystETM_1.5_-_Data_Mapping#common

Hi Mauro,

We have some common JavaScript functions available to Datamapper authors as linked from the wiki above. The key one for this would be common.parseDate(dateString, dateFormat). It takes the date value from your input, along with the target format (As described in Java SimpleDateFormat) to return a Date value.

In use, if we have a CSV file like:

mon_start mon_end ...
01/01/2022 09:00:00 01/01/2022 17:30:00 ...

 

Our Datamapper could have a field mapping to the “Mon Start” field for an SLA, with the following JavaScript expression:

common.parseDate(inbound["mon_start"],'dd/MM/yyyy HH:mm:ss');

Which would look like this in the UI (With “Debug” running to show the result from the above CSV file)

Hope this helps!


Forum|alt.badge.img
  • Author
  • Do Gooder (Customer)
  • 2 replies
  • September 9, 2022

Thanks a lot, SGrant89!! It works!

 

Best regards.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings