Facing issue in the Velocity Script to trim Date, Time and Timezone from one Attribute.
Hey,
I want to trim the Date, time and timezone from single Attribute of the Marketo.
When I used static value it approves the email without error but when I am using Marketo Attribute for the same one it shows the correct value in Preview but shows error while approving the email.
The value of the ${lead.appointmentStartDateTimeText} is 03/04/2020 01:30:00 PM MST
I wan to fetch the Time 01:30:00 PM from the above value.
===========
Below is the script:
#set ($string = "${lead.appointmentStartDateTimeText}")
#set ($s= $string.split(" "))
$s.get(1)
==========
Below is the error:
Validation Error approving Test_program_shweta.EFE_Test_Email — <div>An error occurred when procesing the email Rendered_Email_Velocity_Error_Area_?! </div> <p>Invocation of method 'get' in class [Ljava.lang.String; threw exception java.lang.ArrayIndexOutOfBoundsException near</p> <div><pre >?</pre></div>
====
Would anyone be able to help me here? We would need to Approve the email in order to use it in smart campaign.
Attached the screenshots of the script and errors.
