- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 09:52 AM
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.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 09:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 09:55 AM
What value does it print if you remove the getDisplayValue() method?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 10:21 AM
Using the below still results in "undefined".
template.print("\nTentative closure date: " + current.variables.tentative_closure_date);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 10:58 AM
This actually worked. I had a typo that was causing an issue. Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 11:21 AM
Glad you got your issue resolved!