How to display date field in workflow notification email script

chrish5
Giga Guru

In my workflow, I'm sending a notification with the below mail script in the message section.  All the fields appear correct in the resulting email except for the date field in the red text below.  It is appearing as "undefined".  What's the proper way to display the date?  

 

The following Site Closure request has been submitted

<mail_script>
template.print("\nLocation: " + current.variables.location.getDisplayValue());
template.print("\nLocation contact: " + current.variables.location_contact.getDisplayValue());
template.print("\nOther Contact: " + current.variables.other_contact);
template.print("\nTentative closure date: " + current.variables.tentative_closure_date.getDisplayValue());
template.print("\nIs network needed until inventory is unloaded: " + current.variables.network_needed_until_inventory_is_unloaded);
template.print("\nIs network needed for camera/security: " + current.variables.network_needed_for_cameras_security);
template.print("\nAny lease devices? ");
template.print("\nPrinter: " + current.variables.printer);
template.print("\nScale: " + current.variables.scale);
template.print("\nOther: " + current.variables.other);
template.print("\nOther devices: " + current.variables.other_devices);
template.print("\nUsers/employees moving: " + current.variables.users_employess_moving.getDisplayValue());
template.print("\nUsers/employees termed: " + current.variables.users_employees_termed.getDisplayValue());
template.print("\nUnable to find the moving/termed users/employees in the above fields: " + current.variables.users_employees_moving_termed);
template.print("\n# of PCs: " + current.variables.number_of_pcs);
template.print("\n# of Printers: " + current.variables.number_of_printers);
template.print("\n# of Phones: " + current.variables.number_of_phones);
</mail_script>

If you have questions, please contact the Service Desk.

1 ACCEPTED SOLUTION

Elijah Aromola
Mega Sage

What value does it print if you remove the getDisplayValue() method? 

View solution in original post

4 REPLIES 4

Elijah Aromola
Mega Sage

What value does it print if you remove the getDisplayValue() method? 

Using the below still results in "undefined".

 

template.print("\nTentative closure date: " + current.variables.tentative_closure_date);

This actually worked.  I had a typo that was causing an issue.  Thanks

Glad you got your issue resolved!